From 461c7cff722824e2133456ea3e83bb70a228aedf Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Wed, 29 Jan 2020 23:39:49 -0500 Subject: 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 Change-Id: Ifbddaeb0e15857f42b121af10e30e29dec5c20b2 --- .../python/executor/ComponentRemotePythonExecutor.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'ms/blueprintsprocessor') 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()) -- cgit 1.2.3-korg