From: Faseela K Date: Mon, 8 Feb 2016 12:29:07 +0000 (+0530) Subject: Bug 5267 - Setting vlan id for termination end point not working X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=8b92a3ffd9eeea941d0d5e9114373adaead7c5a9;hp=-c;p=vpnservice.git Bug 5267 - Setting vlan id for termination end point not working Description : Was previously doing a transaction.put() on existing tunnel configuration, which was replacing all the tunnel endpoint details from the datastore Change-Id: I3f294bd45b5e4b48fe411b71cbde9ed199bc13d2 Signed-off-by: Faseela K (cherry picked from commit cfd15ccc2e928048eded503b0b34754be53ab4e8) --- 8b92a3ffd9eeea941d0d5e9114373adaead7c5a9 diff --git a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/renderer/ovs/utilities/SouthboundUtils.java b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/renderer/ovs/utilities/SouthboundUtils.java index 9cb7c1b8..12100561 100644 --- a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/renderer/ovs/utilities/SouthboundUtils.java +++ b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/renderer/ovs/utilities/SouthboundUtils.java @@ -51,11 +51,6 @@ public class SouthboundUtils { if (ifTunnel != null) { addTunnelPortToBridge(ifTunnel, bridgeIid, iface, bridgeAugmentation, bridgeName, portName, dataBroker, tx); } - - IfL2vlan ifL2vlan = iface.getAugmentation(IfL2vlan.class); - if (ifL2vlan != null) { - addVlanPortToBridge(bridgeIid, ifL2vlan, bridgeAugmentation, bridgeName, portName, dataBroker, tx); - } futures.add(tx.submit()); } @@ -82,8 +77,9 @@ public class SouthboundUtils { private static void addVlanPortToBridge(InstanceIdentifier bridgeIid, IfL2vlan ifL2vlan, OvsdbBridgeAugmentation bridgeAugmentation, String bridgeName, String portName, DataBroker dataBroker, WriteTransaction t) { - int vlanId = ifL2vlan.getVlanId().getValue(); - addTerminationPoint(bridgeIid, bridgeAugmentation, bridgeName, portName, vlanId, null, null, dataBroker, t); + if(ifL2vlan.getVlanId() != null) { + addTerminationPoint(bridgeIid, bridgeAugmentation, bridgeName, portName, ifL2vlan.getVlanId().getValue(), null, null, dataBroker, t); + } } private static void addTunnelPortToBridge(IfTunnel ifTunnel, InstanceIdentifier bridgeIid, Interface iface,