Set the reply success status from the result of the command 02/85502/1
authorJames Guistwite <jguistwite@iconectiv.com>
Tue, 16 Apr 2019 17:31:11 +0000 (13:31 -0400)
committerJames Guistwite <jguistwite@iconectiv.com>
Tue, 16 Apr 2019 17:33:40 +0000 (13:33 -0400)
Issue-ID: CLI-155

Change-Id: I5baa339cd5f4e26f607eab9f18f151ad06869c0e
Signed-off-by: James Guistwite <jguistwite@iconectiv.com>
grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java

index 0c2f00b..79d761d 100644 (file)
@@ -211,12 +211,14 @@ public class OpenInterfaceGrpcServer {
                 if (!cmd.isRpc()) {
                     String printOut = cmd.getResult().print();
                     Builder reply = Output.newBuilder();
-                    reply.setSuccess(true);
                     reply.putAttrs(OnapCommandConstants.ERROR, "{}");
 
                     if (executionStoreContext != null)
                         reply.putAddons("execution-id", executionStoreContext.getExecutionId());
 
+                    // use the status from the plugin.
+                    reply.setSuccess(cmd.getResult().isPassed());
+
                     try {
                         reply.putAttrs(OnapCommandConstants.RESULTS, new ObjectMapper().readTree(printOut).toString());
                     } catch (IOException e) {