Merge "Handle shcema without namespace."
authorJakub Morvay <jmorvay@cisco.com>
Wed, 22 Mar 2017 14:21:52 +0000 (14:21 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 22 Mar 2017 14:21:52 +0000 (14:21 +0000)
restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/restconf/impl/BrokerFacade.java
restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/PatchDataTransactionUtil.java

index f8f4acfe470194eee7a0a4abbf5a2eedc0762397..2d72b78faef07daf6fcd092409b4502ffc7114f5 100644 (file)
@@ -1160,12 +1160,9 @@ public class BrokerFacade {
         LOG.trace("Merge {} within Restconf PATCH: {} with payload {}", datastore.name(), path, payload);
         ensureParentsByMerge(datastore, path, writeTransaction, schemaContext);
 
-        // merging is necessary only for lists otherwise we can call put method
-        if (payload instanceof MapNode) {
-            writeTransaction.merge(datastore, path, payload);
-        } else {
-            writeTransaction.put(datastore, path, payload);
-        }
+        // Since YANG Patch provides the option to specify what kind of operation for each edit,
+        // OpenDaylight should not change it.
+        writeTransaction.merge(datastore, path, payload);
     }
 
     public void setDomDataBroker(final DOMDataBroker domDataBroker) {
index ded3543a88f3293c7c82dc4ea75de87b040d9cb1..5e88d6d734b6566dc4528dea83586408fbb590bb 100644 (file)
@@ -199,13 +199,7 @@ public final class PatchDataTransactionUtil {
                                                    final SchemaContextRef schemaContextRef) {
         LOG.trace("Merge {} within Restconf PATCH: {} with payload {}", dataStore.name(), path, payload);
         TransactionUtil.ensureParentsByMerge(path, schemaContextRef.get(), writeTransaction);
-
-        // merging is necessary only for lists otherwise we can call put method
-        if (payload instanceof MapNode) {
-            writeTransaction.merge(dataStore, path, payload);
-        } else {
-            writeTransaction.put(dataStore, path, payload);
-        }
+        writeTransaction.merge(dataStore, path, payload);
     }
 
     /**