From c5684c3e3a81d58eedc3dbee3d943ba20c6ddfa5 Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Tue, 23 Nov 2021 09:23:44 -0500 Subject: CCSDK-3531 improve cmd-exec returned err msg Issue-ID: CCSDK-3531 Improve end-user CBA's Python scripts ability to return error messages on failues. See JIRA story for examples: https://jira.onap.org/browse/CCSDK-3531 adds functions send_response_err_msg(err_message) and send_response_err_msg_and_exit(ret_err_msg, code=1) Signed-off-by: Oleg Mitsura Change-Id: Ideda64dd108f987c3c4515c70daf9f7b6d2b1f2f --- .../blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt | 3 ++- .../services/execution/RemoteScriptExecutionService.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'ms/blueprintsprocessor/modules') diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt index d8baa8eaf..b62ffb898 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt +++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/api/data/BlueprintRemoteProcessorData.kt @@ -69,7 +69,8 @@ data class RemoteScriptExecutionOutput( var response: List, var status: StatusType = StatusType.SUCCESS, var timestamp: Date = Date(), - var payload: JsonNode + var payload: JsonNode, + var errMsg: String? ) data class PrepareRemoteEnvInput( diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt index ff6027341..26375e081 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/RemoteScriptExecutionService.kt @@ -207,7 +207,8 @@ class GrpcRemoteScriptExecutionService(private val bluePrintGrpcLibPropertyServi requestId = this.requestId, response = this.responseList, status = StatusType.valueOf(this.status.name), - payload = payload.jsonAsJsonType() + payload = payload.jsonAsJsonType(), + errMsg = errMsg ) } -- cgit 1.2.3-korg