org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder ifaceBuilder =
new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder();
if (stateIf.isPresent()) {
- stateIface = ifaceBuilder.setOperStatus(opStatus).build();
+ stateIface = ifaceBuilder.setOperStatus(opStatus).setKey(IfmUtil.getStateInterfaceKeyFromName(ifName)).build();
LOG.trace("Setting OperStatus for {} to {} in OPERATIONAL DS", ifName, opStatus);
asyncUpdate(LogicalDatastoreType.OPERATIONAL, id, stateIface, DEFAULT_CALLBACK);
}
Class<? extends InterfaceType> ifType = iface.getType();
long dpn = this.getDpnForInterface(ifName);
long portNo = this.getPortNumForInterface(iface).longValue();
-
if (iface.isEnabled()) {
if(ifType.isAssignableFrom(L2vlan.class)) {
IfL2vlan vlanIface = iface.getAugmentation(IfL2vlan.class);
- long vlanVid = vlanIface.getVlanId();
LOG.trace("L2Vlan: {}",vlanIface);
+ long vlanVid = (vlanIface == null) ? 0 : vlanIface.getVlanId();
if (vlanVid != 0) {
listActionInfo.add(new ActionInfo(ActionType.push_vlan, new String[] {}));
listActionInfo.add(new ActionInfo(ActionType.set_field_vlan_vid,
} catch (Exception e) {
LOG.error("OFPort for Interface {} not found", iface.getName());
}
- return null;
+ return 0L;
}
}
// check if vpn node is there or to be created
InstanceIdentifier<VpnNexthops> id = idBuilder.build();
- Optional<VpnNexthops> nexthops = read(LogicalDatastoreType.CONFIGURATION, id);
+ Optional<VpnNexthops> nexthops = read(LogicalDatastoreType.OPERATIONAL, id);
if (!nexthops.isPresent()) {
// create a new node
VpnNexthops node = new VpnNexthopsBuilder().setKey(new VpnNexthopsKey(vpnId)).setVpnId(vpnId).build();
// check if dpn node is there or to be created
InstanceIdentifier<TunnelNexthops> id = idBuilder.build();
- Optional<TunnelNexthops> nexthops = read(LogicalDatastoreType.CONFIGURATION, id);
+ Optional<TunnelNexthops> nexthops = read(LogicalDatastoreType.OPERATIONAL, id);
if (!nexthops.isPresent()) {
// create a new node
TunnelNexthops node = new TunnelNexthopsBuilder()
InstanceIdentifierBuilder<VpnNexthops> idBuilder = InstanceIdentifier.builder(L3nexthop.class)
.child(VpnNexthops.class, new VpnNexthopsKey(vpnId));
InstanceIdentifier<VpnNexthops> id = idBuilder.build();
- Optional<VpnNexthops> vpnNexthops = read(LogicalDatastoreType.CONFIGURATION, id);
- if (!vpnNexthops.isPresent()) {
+ Optional<VpnNexthops> vpnNexthops = read(LogicalDatastoreType.OPERATIONAL, id);
+ if (vpnNexthops.isPresent()) {
// get nexthops list for vpn
List<VpnNexthop> nexthops = vpnNexthops.get().getVpnNexthop();
// check if vpn node is there
InstanceIdentifier<TunnelNexthops> id = idBuilder.build();
- Optional<TunnelNexthops> dpnNexthops = read(LogicalDatastoreType.CONFIGURATION, id);
- if (!dpnNexthops.isPresent()) {
+ Optional<TunnelNexthops> dpnNexthops = read(LogicalDatastoreType.OPERATIONAL, id);
+ if (dpnNexthops.isPresent()) {
List<TunnelNexthop> nexthops = dpnNexthops.get().getTunnelNexthop();
for (TunnelNexthop nexthop : nexthops) {
if (nexthop.getIpAddress().equals(ipAddress)) {