summaryrefslogtreecommitdiffstats
path: root/saltstack-adapter/saltstack-adapter-provider/src/main
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-17 11:02:17 +0900
committerGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-17 11:19:50 +0900
commitb08a1b8cf2440fac7fc3d7eb7580a58d977524a2 (patch)
treee87f032dfc96ff1ced3204d610a9453e961b1412 /saltstack-adapter/saltstack-adapter-provider/src/main
parentaeeba1d69f0498808252d5555b06b8fb6cae9269 (diff)
saltstack adaptor DGs addition
Issue-ID: CCSDK-368 Change-Id: I5f66693109c14eb64e4576caeeb84440a940fffa Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'saltstack-adapter/saltstack-adapter-provider/src/main')
-rw-r--r--saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java
index e4bceb5ba..77874b0e5 100644
--- a/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java
+++ b/saltstack-adapter/saltstack-adapter-provider/src/main/java/org/onap/ccsdk/sli/adaptors/saltstack/impl/SaltstackAdapterImpl.java
@@ -292,13 +292,8 @@ public class SaltstackAdapterImpl implements SaltstackAdapter {
return;
} else {
logger.info(String.format("Execution of request : successful."));
- if (slsExec) {
- ctx.setAttribute(RESULT_CODE_ATTRIBUTE_NAME, Integer.toString(testResult.getStatusCode()));
- ctx.setAttribute(MESSAGE_ATTRIBUTE_NAME, "success");
- } else {
- ctx.setAttribute(RESULT_CODE_ATTRIBUTE_NAME, Integer.toString(SaltstackResultCodes.CHECK_CTX_FOR_CMD_SUCCESS.getValue()));
- ctx.setAttribute(MESSAGE_ATTRIBUTE_NAME, "check context for execution status");
- }
+ ctx.setAttribute(RESULT_CODE_ATTRIBUTE_NAME, Integer.toString(testResult.getStatusCode()));
+ ctx.setAttribute(MESSAGE_ATTRIBUTE_NAME, "success");
ctx.setAttribute(ID_ATTRIBUTE_NAME, reqID);
}
}
@@ -318,7 +313,8 @@ public class SaltstackAdapterImpl implements SaltstackAdapter {
reqID = messageProcessor.reqId(params);
String commandToExecute = messageProcessor.reqCmd(params);
slsExec = messageProcessor.reqIsSLSExec(params);
- testResult = execCommand(ctx, params, commandToExecute, -1);
+ long execTimeout = messageProcessor.reqExecTimeout(params);
+ testResult = execCommand(ctx, params, commandToExecute, execTimeout);
testResult = messageProcessor.parseResponse(ctx, reqID, testResult, slsExec);
checkResponseStatus(testResult, ctx, reqID, slsExec);
} catch (IOException e) {