update even when original schema has no DPNs 23/41923/1
authorDimple Jain <dimple.jain@ericsson.com>
Sun, 17 Jul 2016 11:05:25 +0000 (16:35 +0530)
committerDimple Jain <dimple.jain@ericsson.com>
Sun, 17 Jul 2016 11:07:23 +0000 (16:37 +0530)
Change-Id: Iee9692ce18445e7b9a7af08b75e581c892bd6f43
Signed-off-by: Dimple Jain <dimple.jain@ericsson.com>
itm/itm-impl/src/main/java/org/opendaylight/genius/itm/impl/ItmProvider.java

index 53524edf1c6f79b4cc994e53eea7586e353f13bf..f2bafbd648887d1427f105130bd6f7248fe0967b 100644 (file)
@@ -258,9 +258,9 @@ public class ItmProvider implements BindingAwareProvider, AutoCloseable, IITMPro
         VtepConfigSchema schema = ItmUtils.validateForUpdateVtepSchema(schemaName, lstDpnsForAdd, lstDpnsForDelete,
                 this);
         VtepConfigSchemaBuilder builder = new VtepConfigSchemaBuilder(schema);
-        if (ItmUtils.getDpnIdList(schema.getDpnIds()).isEmpty()) {
+       /* if (ItmUtils.getDpnIdList(schema.getDpnIds()).isEmpty()) {
             builder.setDpnIds(schema.getDpnIds());
-        } else {
+        } else {*/
             if (lstDpnsForAdd != null && !lstDpnsForAdd.isEmpty()) {
                 List<BigInteger> originalDpnList = ItmUtils.getDpnIdList(schema.getDpnIds()) ;
                 originalDpnList.addAll(lstDpnsForAdd) ;
@@ -268,11 +268,11 @@ public class ItmProvider implements BindingAwareProvider, AutoCloseable, IITMPro
             }
             if (lstDpnsForDelete != null && !lstDpnsForDelete.isEmpty()) {
                 List<BigInteger> originalDpnList = ItmUtils.getDpnIdList(schema.getDpnIds()) ;
-                originalDpnList.removeAll(lstDpnsForAdd) ;
+                originalDpnList.removeAll(lstDpnsForDelete) ;
                 builder.setDpnIds(ItmUtils.getDpnIdsListFromBigInt(originalDpnList)) ;
                 // schema.setDpnIds(ItmUtils.getDpnIdsListFromBigInt(ItmUtils.getDpnIdList(schema.getDpnIds()).removeAll(lstDpnsForAdd)));
             }
-        }
+       // }
         schema = builder.build();
         MDSALUtil.syncWrite(this.dataBroker, LogicalDatastoreType.CONFIGURATION,
                 ItmUtils.getVtepConfigSchemaIdentifier(schemaName), schema);