summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/python-executor
diff options
context:
space:
mode:
authorOleg Mitsura <oleg.mitsura@amdocs.com>2020-01-29 23:39:49 -0500
committerOleg Mitsura <oleg.mitsura@amdocs.com>2020-03-31 04:07:22 -0400
commit461c7cff722824e2133456ea3e83bb70a228aedf (patch)
treee095d459c3a9d4ad0e968a68ea02f932fb9545c3 /ms/blueprintsprocessor/functions/python-executor
parent9f92c18e8cccc5f15a7c65ef3e95252316360077 (diff)
Improving CMD-exec err msgs/handling.
Issue-ID: CCSDK-2049 rev1. initial commit rev2. added better logging/passing errors. rev3. bugfixes rev4. bugfix for CommandExecutorServer.prepareEnv return status was still returning bool. (was caught only during a defective mariadb pip package install!) Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ifbddaeb0e15857f42b121af10e30e29dec5c20b2
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor')
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
index f3169d937..96b7cc0cc 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
@@ -142,12 +142,16 @@ open class ComponentRemotePythonExecutor(private val remoteScriptExecutionServic
setNodeOutputProperties(prepareEnvOutput.status.name.asJsonPrimitive(), logsEnv, "".asJsonPrimitive())
}
}
+ else {
+ //set env preparation log to empty...
+ setAttribute(ATTRIBUTE_PREPARE_ENV_LOG,"".asJsonPrimitive());
+ }
} catch (grpcEx: io.grpc.StatusRuntimeException) {
- val timeoutErrMsg = "Command executor timed out in GRPC call during env. preparation.. timeout($envPrepTimeout) requestId ($processId)."
- setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, timeoutErrMsg.asJsonPrimitive())
- setNodeOutputErrors(status = timeoutErrMsg, message = "${grpcEx.status}".asJsonPrimitive())
- log.error(timeoutErrMsg, grpcEx)
- addError(timeoutErrMsg)
+ val grpcErrMsg = "Command failed during env. preparation... timeout($envPrepTimeout) requestId ($processId)."
+ setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, grpcErrMsg.asJsonPrimitive())
+ setNodeOutputErrors(status = grpcErrMsg, message = "${grpcEx.status}".asJsonPrimitive())
+ log.error(grpcErrMsg, grpcEx)
+ addError(grpcErrMsg)
} catch (e: Exception) {
val timeoutErrMsg = "Command executor failed during env. preparation.. timeout($envPrepTimeout) requestId ($processId)."
setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, e.message.asJsonPrimitive())