aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Guistwite <jguistwite@iconectiv.com>2019-04-16 13:31:11 -0400
committerJames Guistwite <jguistwite@iconectiv.com>2019-04-16 13:33:40 -0400
commitba7b56a4518c26153b7f68fc200fb9ddeb70fcf2 (patch)
treee34d09e870514ca20a73a9abd9b95d987b653c43
parent34605c95ea7a9af4c4b86a4b5dee81a40d60686f (diff)
Set the reply success status from the result of the command
Issue-ID: CLI-155 Change-Id: I5baa339cd5f4e26f607eab9f18f151ad06869c0e Signed-off-by: James Guistwite <jguistwite@iconectiv.com>
-rw-r--r--grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java
index 0c2f00b5..79d761d6 100644
--- a/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java
+++ b/grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java
@@ -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) {