Delete vlan-member should remove the interface parent info, if it is the 20/36120/1
authorFaseela K <faseela.k@ericsson.com>
Mon, 7 Mar 2016 17:31:56 +0000 (23:01 +0530)
committerFaseela K <faseela.k@ericsson.com>
Fri, 11 Mar 2016 12:32:53 +0000 (18:02 +0530)
last child of the parent

Change-Id: If6dfb7a35ae1d382e3540a49b2c85bdf492772fd
Signed-off-by: Faseela K <faseela.k@ericsson.com>
interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/renderer/ovs/confighelpers/OvsVlanMemberConfigRemoveHelper.java

index 25d9c20b0e717b40a6be9c5d14032869894cb87b..d66147e100765eb40a640997bc1a9b596af7550c 100644 (file)
@@ -52,15 +52,15 @@ public class OvsVlanMemberConfigRemoveHelper {
             return futures;
         }
 
+        //Delete the interface child information
         List<InterfaceChildEntry> interfaceChildEntries = interfaceParentEntry.getInterfaceChildEntry();
-        if (interfaceChildEntries.size() <= 1) {
-            // FIXME..some boundary problem during vlan member deletion..need to revisit
-            //t.delete(LogicalDatastoreType.CONFIGURATION, interfaceParentEntryIid);
-        } else {
-            InterfaceChildEntryKey interfaceChildEntryKey = new InterfaceChildEntryKey(interfaceOld.getName());
-            InstanceIdentifier<InterfaceChildEntry> interfaceChildEntryIid =
+        InterfaceChildEntryKey interfaceChildEntryKey = new InterfaceChildEntryKey(interfaceOld.getName());
+        InstanceIdentifier<InterfaceChildEntry> interfaceChildEntryIid =
                     InterfaceMetaUtils.getInterfaceChildEntryIdentifier(interfaceParentEntryKey, interfaceChildEntryKey);
-            t.delete(LogicalDatastoreType.CONFIGURATION, interfaceChildEntryIid);
+        t.delete(LogicalDatastoreType.CONFIGURATION, interfaceChildEntryIid);
+        //If this is the last child, remove the interface parent info as well.
+        if (interfaceChildEntries.size() <= 1) {
+            t.delete(LogicalDatastoreType.CONFIGURATION, interfaceParentEntryIid);
         }
 
         org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState =