Bump upstreams to SNAPSHOTs
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / services / impl / RestconfDataServiceImpl.java
index 69a1fdb8d571561f6381f1cde2965621b8d3124b..f038ad07b5e0d7305c68cf9e7f23690370082be3 100644 (file)
@@ -16,7 +16,6 @@ import static org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsCo
 import static org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants.STREAM_PATH_PART;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.net.URI;
@@ -75,7 +74,6 @@ import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
@@ -327,8 +325,7 @@ public class RestconfDataServiceImpl implements RestconfDataService {
         }
 
         final DOMMountPoint mountPoint = context.getMountPoint();
-        final Absolute schemaPath = Absolute.of(ImmutableList.copyOf(context.getSchemaNode().getPath()
-            .getPathFromRoot()));
+        final Absolute schemaPath = context.inference().toSchemaInferenceStack().toSchemaNodeIdentifier();
         final DOMActionResult response;
         if (mountPoint != null) {
             response = invokeAction((ContainerNode) data, schemaPath, yangIIdContext, mountPoint);
@@ -380,8 +377,8 @@ public class RestconfDataServiceImpl implements RestconfDataService {
         return RestconfInvokeOperationsServiceImpl.checkedGet(Futures.catching(actionService.invokeAction(
             schemaPath, new DOMDataTreeIdentifier(LogicalDatastoreType.OPERATIONAL, yangIId.getParent()), data),
             DOMActionException.class,
-            cause -> new SimpleDOMActionResult(ImmutableList.of(RpcResultBuilder.newError(
-                RpcError.ErrorType.RPC, "operation-failed", cause.getMessage()))),
+            cause -> new SimpleDOMActionResult(List.of(RpcResultBuilder.newError(
+                ErrorType.RPC, ErrorTag.OPERATION_FAILED, cause.getMessage()))),
             MoreExecutors.directExecutor()));
     }