Do not send 'commit' to the devices without candidate 93/103693/6
authorSangwook Ha <sangwook.ha@verizon.com>
Fri, 16 Dec 2022 01:06:05 +0000 (17:06 -0800)
committerRobert Varga <nite@hq.sk>
Sun, 18 Dec 2022 17:45:33 +0000 (17:45 +0000)
The 'commit' RPC should not be sent to the devices only with
'writable-running' and without 'candidate' capability.

Override the commit method for the 'Running' NetconfDataTreeService
to immediately return a DomRpcResult without any errors.

JIRA: NETCONF-933
Change-Id: Ic0e51135e3ae347213d8ef8dbc03deb282d47af3
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/AbstractNetconfDataTreeService.java

index 22c2f2768400bf604c28b18de37616df74a05b7d..694b81365b8d79757e78c62c555b03790a78994b 100644 (file)
@@ -84,6 +84,12 @@ public abstract class AbstractNetconfDataTreeService implements NetconfDataTreeS
             return RPC_SUCCESS;
         }
 
+        @Override
+        public ListenableFuture<DOMRpcResult> commit() {
+            // No candidate, hence we commit immediately
+            return RPC_SUCCESS;
+        }
+
         @Override
         ListenableFuture<? extends DOMRpcResult> lockSingle() {
             return netconfOps.lockRunning(new NetconfRpcFutureCallback("Lock running", id));