Do not send 'commit' to the devices without candidate 68/103268/2
authorSangwook Ha <sangwook.ha@verizon.com>
Fri, 16 Dec 2022 01:06:05 +0000 (17:06 -0800)
committerRobert Varga <nite@hq.sk>
Tue, 3 Jan 2023 10:28:16 +0000 (10:28 +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>
(cherry picked from commit 3f566e5d24c17abd9643dd854b11d4345231a2e1)

netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/AbstractNetconfDataTreeService.java

index a050cebdc86499342c09b1b79bd0d45fa0c13eab..662518db30c7e1675d52062e3ae9e6e888e1a217 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));