Python executor: Execution command and prepare environment log 15/89915/3
authorSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Fri, 14 Jun 2019 17:13:22 +0000 (13:13 -0400)
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Fri, 14 Jun 2019 19:39:37 +0000 (15:39 -0400)
Also fix error messages return when something goes wrong.

Issue-ID: CCSDK-1404
Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Change-Id: Ifff396d8cee8d6608b6fb32d3a8e941a253ba24c

components/model-catalog/resource-dictionary/starter-dictionary/properties-capability-source.json [new file with mode: 0644]
ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt

diff --git a/components/model-catalog/resource-dictionary/starter-dictionary/properties-capability-source.json b/components/model-catalog/resource-dictionary/starter-dictionary/properties-capability-source.json
new file mode 100644 (file)
index 0000000..950c4a2
--- /dev/null
@@ -0,0 +1,26 @@
+{\r
+  "name": "properties-capability-source",\r
+  "updated-by": "Steve Alphonse Siani, alphonse.steve.siani.djissitchi@ibm.com",\r
+  "tags": "properties-capability-source",\r
+  "property" :{\r
+    "description": "Data dictionary used to read properties.",\r
+    "type": "string"\r
+  },\r
+  "sources": {\r
+    "input": {\r
+      "type": "source-input"\r
+    },\r
+    "default": {\r
+      "type": "source-default",\r
+      "properties": {}\r
+    },\r
+    "capability": {\r
+      "type": "source-capability",\r
+      "properties" : {\r
+        "script-type" : "jython",\r
+        "script-class-reference" : "Scripts/python/ResolvProperties.py",\r
+        "instance-dependencies" : []\r
+      }\r
+    }\r
+  }\r
+}
\ No newline at end of file
index 4642a7c..4ef1cfb 100644 (file)
@@ -95,6 +95,7 @@ open class ComponentRemotePythonExecutor(private val remoteScriptExecutionServic
                         packages = packages
                 )
                 val prepareEnvOutput = remoteScriptExecutionService.prepareEnv(prepareEnvInput)
+                log.info("$ATTRIBUTE_PREPARE_ENV_LOG - ${prepareEnvOutput.response}")
                 setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, prepareEnvOutput.response.asJsonPrimitive())
                 setAttribute(ATTRIBUTE_EXEC_CMD_LOG, "N/A".asJsonPrimitive())
                 check(prepareEnvOutput.status == StatusType.SUCCESS) {
@@ -110,6 +111,7 @@ open class ComponentRemotePythonExecutor(private val remoteScriptExecutionServic
                     command = scriptCommand,
                     properties = properties)
             val remoteExecutionOutput = remoteScriptExecutionService.executeCommand(remoteExecutionInput)
+            log.info("$ATTRIBUTE_EXEC_CMD_LOG  - ${remoteExecutionOutput.response}")
             setAttribute(ATTRIBUTE_EXEC_CMD_LOG, remoteExecutionOutput.response.asJsonPrimitive())
             check(remoteExecutionOutput.status == StatusType.SUCCESS) {
                 "failed to get prepare remote command response status for requestId(${remoteExecutionOutput.requestId})"