Fix NETCONF error message propagation to RESTCONF 33/100033/1
authorPeter Puškár <ppuskar@frinx.io>
Fri, 18 Mar 2022 16:45:19 +0000 (17:45 +0100)
committerPeter Puskar <ppuskar@frinx.io>
Fri, 18 Mar 2022 17:10:52 +0000 (17:10 +0000)
This small typo during refactor caused an issue where NETCONF error
messages would not be propagated into RESTCONF response in some cases
where transaction failed.

Signed-off-by: Peter Puškár <ppuskar@frinx.io>
Change-Id: I4c5179f8ec575da112ac0f76da40436900291cb9

restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/transactions/NetconfRestconfTransaction.java

index 5c03c7c082d6e69be8b51f9868eca90a7d057335..9fe52c6216fb94bf0711f8cc50b40ebc6b70cd4b 100644 (file)
@@ -140,7 +140,7 @@ final class NetconfRestconfTransaction extends RestconfTransaction {
                 Futures.addCallback(netconfService.commit(), new FutureCallback<DOMRpcResult>() {
                     @Override
                     public void onSuccess(final DOMRpcResult rpcResult) {
-                        final Collection<? extends RpcError> errors = result.getErrors();
+                        final Collection<? extends RpcError> errors = rpcResult.getErrors();
                         if (errors.isEmpty()) {
                             Futures.whenAllComplete(netconfService.unlock()).run(
                                 () -> commitResult.set(CommitInfo.empty()),