diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2019-04-23 12:59:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-23 12:59:18 +0000 |
commit | 26fc3d01a9be64e10cbeb814559fd98fefbd7ba7 (patch) | |
tree | 48b93671c5e7fc4d631d3169dc86b8c72f9550ae | |
parent | 513a83a0505d9c659e8abedfc1716c3ac8b06f00 (diff) | |
parent | ba7b56a4518c26153b7f68fc200fb9ddeb70fcf2 (diff) |
Merge "Set the reply success status from the result of the command"
-rw-r--r-- | grpc/grpc-server/src/main/java/org/open/infc/grpc/server/OpenInterfaceGrpcServer.java | 4 |
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) { |