Fix improper cleanup of operational data in sal-netconf-connector's disconnect 20/13420/1
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 5 Dec 2014 13:31:37 +0000 (14:31 +0100)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 5 Dec 2014 14:00:49 +0000 (15:00 +0100)
Use put instead of merge to fully replace operational data on ever yupdate

Change-Id: I8ebf19a9bcfaba9cc56be6967999754265e44236
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceDatastoreAdapter.java

index 04d5e5e..fc69a7e 100644 (file)
@@ -58,7 +58,7 @@ final class NetconfDeviceDatastoreAdapter implements AutoCloseable {
 
         final ReadWriteTransaction transaction = dataService.newReadWriteTransaction();
         logger.trace("{}: Update device state transaction {} merging operational data started.", id, transaction.getIdentifier());
-        transaction.merge(LogicalDatastoreType.OPERATIONAL, id.getBindingPath(), data);
+        transaction.put(LogicalDatastoreType.OPERATIONAL, id.getBindingPath(), data);
         logger.trace("{}: Update device state transaction {} merging operational data ended.", id, transaction.getIdentifier());
 
         commitTransaction(transaction, "update");
@@ -83,11 +83,11 @@ final class NetconfDeviceDatastoreAdapter implements AutoCloseable {
         final Node nodeWithId = getNodeWithId(id);
 
         logger.trace("{}: Init device state transaction {} putting if absent operational data started.", id, transaction.getIdentifier());
-        transaction.merge(LogicalDatastoreType.OPERATIONAL, path, nodeWithId);
+        transaction.put(LogicalDatastoreType.OPERATIONAL, path, nodeWithId);
         logger.trace("{}: Init device state transaction {} putting operational data ended.", id, transaction.getIdentifier());
 
         logger.trace("{}: Init device state transaction {} putting if absent config data started.", id, transaction.getIdentifier());
-        transaction.merge(LogicalDatastoreType.CONFIGURATION, path, nodeWithId);
+        transaction.put(LogicalDatastoreType.CONFIGURATION, path, nodeWithId);
         logger.trace("{}: Init device state transaction {} putting config data ended.", id, transaction.getIdentifier());
 
         commitTransaction(transaction, "init");

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.