aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/model-catalog/blueprint-model/pom.xml37
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta2
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/capability_cli/pom.xml10
-rwxr-xr-xcomponents/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta5
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/golden/TOSCA-Metadata/TOSCA.meta3
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/pom.xml38
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta4
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta3
-rw-r--r--components/model-catalog/blueprint-model/test-blueprint/resource-audit/pom.xml12
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/pnf_config.json (renamed from components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json)2
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config/TOSCA-Metadata/TOSCA.meta4
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml4
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/pnf_config_aai.json (renamed from components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/activation-blueprint.json)2
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/TOSCA-Metadata/TOSCA.meta6
-rw-r--r--components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Tests/uat.yaml4
-rw-r--r--components/pom.xml37
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt52
-rw-r--r--ms/command-executor/src/main/python/command_executor_server.py4
-rw-r--r--pom.xml2
19 files changed, 180 insertions, 51 deletions
diff --git a/components/model-catalog/blueprint-model/pom.xml b/components/model-catalog/blueprint-model/pom.xml
new file mode 100644
index 000000000..5b852d2a0
--- /dev/null
+++ b/components/model-catalog/blueprint-model/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>cba-parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>CBA - Blueprints</name>
+ <description>CBA - Blueprints</description>
+
+ <modules>
+ <module>test-blueprint</module>
+ </modules>
+</project>
diff --git a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta
index 8f1df9f2a..854c20ba2 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/test-blueprint/baseconfiguration/TOSCA-Metadata/TOSCA.meta
@@ -3,4 +3,6 @@ CSAR-Version: 1.0
Created-By: Brinda Santh <brindasanth@in.ibm.com>
Entry-Definitions: Definitions/activation-blueprint.json
Template-Tags: Brinda Santh, activation-blueprint
+Template-Name: baseconfiguration
+Template-Version: 1.0.0
diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/pom.xml b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/pom.xml
index c71449678..ea76d50b9 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/capability_cli/pom.xml
+++ b/components/model-catalog/blueprint-model/test-blueprint/capability_cli/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 IBM.
+ ~ Modification Copyright © 2018-2019 AT&T Intellectual Property.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -18,16 +19,15 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>cba-parent</artifactId>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>test-blueprint-model</artifactId>
<version>0.7.0-SNAPSHOT</version>
</parent>
- <groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>capability_cli</artifactId>
- <name>CBA Capability CLI</name>
- <description>CBA Capability CLI</description>
+ <name>CBA - Test Capability CLI</name>
+ <description>CBA - Test Capability CLI</description>
<dependencies>
<dependency>
diff --git a/components/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta
index 9066e4845..8aad13cfd 100755
--- a/components/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/test-blueprint/capability_python/TOSCA-Metadata/TOSCA.meta
@@ -3,6 +3,5 @@ CSAR-Version: 1.0
Created-By: Brinda Santh M
Entry-Definitions: Definitions/activation-blueprint.json
Template-Tags: Brinda Santh, activation-blueprint
-
-Name: Plans/ActivateProcess.bpmn
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: capability_python
+Template-Version: 1.0.0
diff --git a/components/model-catalog/blueprint-model/test-blueprint/golden/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/golden/TOSCA-Metadata/TOSCA.meta
index b8f3a202a..f85c611f8 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/golden/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/test-blueprint/golden/TOSCA-Metadata/TOSCA.meta
@@ -3,4 +3,5 @@ CSAR-Version: 1.0
Created-By: Alexis de Talhouët
Entry-Definitions: Definitions/golden-blueprint.json
Template-Tags: test
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: golden
+Template-Version: 1.0.0 \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/test-blueprint/pom.xml b/components/model-catalog/blueprint-model/test-blueprint/pom.xml
new file mode 100644
index 000000000..f9dab0227
--- /dev/null
+++ b/components/model-catalog/blueprint-model/test-blueprint/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>test-blueprint-model</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>CBA - Test Blueprints</name>
+ <description>CBA - Test Blueprints</description>
+
+ <modules>
+ <module>capability_cli</module>
+ <module>resource-audit</module>
+ </modules>
+</project>
diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta
index 17448a835..efaeabf11 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/test-blueprint/remote_ansible/TOSCA-Metadata/TOSCA.meta
@@ -2,4 +2,6 @@ TOSCA-Meta-File-Version: 1.0.0
CSAR-Version: 1.0
Created-By: Serge Simard <serge@agilitae.com>
Entry-Definitions: Definitions/remote_ansible.json
-Template-Tags: Serge Simard, remote_ansible \ No newline at end of file
+Template-Tags: Serge Simard, remote_ansible
+Template-Name: remote_ansible
+Template-Version: 1.0.0 \ No newline at end of file
diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta
index 2c3a91f28..2e3ed2c2e 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/TOSCA-Metadata/TOSCA.meta
@@ -3,4 +3,5 @@ CSAR-Version: 1.0
Created-By: Brinda Santh <brindasanth@in.ibm.com>
Entry-Definitions: Definitions/remote_scripts.json
Template-Tags: Brinda Santh, remote_scripts
-Content-Type: application/vnd.oasis.bpmn
+Template-Name: remote_scripts
+Template-Version: 1.0.0
diff --git a/components/model-catalog/blueprint-model/test-blueprint/resource-audit/pom.xml b/components/model-catalog/blueprint-model/test-blueprint/resource-audit/pom.xml
index 527e2b62b..5f6c49e0c 100644
--- a/components/model-catalog/blueprint-model/test-blueprint/resource-audit/pom.xml
+++ b/components/model-catalog/blueprint-model/test-blueprint/resource-audit/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 IBM.
+ ~ Modification Copyright © 2018-2019 AT&T Intellectual Property.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -16,15 +17,18 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
- <artifactId>cba-parent</artifactId>
+ <groupId>org.onap.ccsdk.cds.cba</groupId>
+ <artifactId>test-blueprint-model</artifactId>
<version>0.7.0-SNAPSHOT</version>
</parent>
+
<groupId>org.onap.ccsdk.cds.components.cba</groupId>
<artifactId>resource-audit</artifactId>
- <name>CBA Resource Audit</name>
- <description>CBA Resource Audit</description>
+
+ <name>CBA - Test Resource Audit</name>
+ <description>CBA - Test Resource Audit</description>
<dependencies>
<dependency>
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/pnf_config.json
index 1a7ba559a..c22764056 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/activation-blueprint.json
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Definitions/pnf_config.json
@@ -4,7 +4,7 @@
"template_author" : "Rodrigo Ottero",
"author-email" : "rodrigo.ottero@est.tech",
"user-groups" : "ADMIN, OPERATION",
- "template_name" : "configuration_over_restconf",
+ "template_name" : "pnf_config",
"template_version" : "1.0.0",
"template_tags" : "pnf, restconf, config, configuration"
},
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/TOSCA-Metadata/TOSCA.meta
index ca0637328..096bd7d3f 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/TOSCA-Metadata/TOSCA.meta
@@ -1,7 +1,7 @@
TOSCA-Meta-File-Version: 1.0.0
CSAR-Version: 1.0
Created-By: Rodrigo Ottero
-Entry-Definitions: Definitions/activation-blueprint.json
-Template-Name: activation-blueprint
+Entry-Definitions: Definitions/pnf_config.json
+Template-Name: pnf_config
Template-Version: 1.0.0
Template-Tags: activation-blueprint
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
index 518bbe020..85b10c611 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config/Tests/uat.yaml
@@ -8,7 +8,7 @@ processes:
requestId: "123456-1000"
subRequestId: sub-123456-1000
actionIdentifiers: &assign-ai
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config
blueprintVersion: "1.0.0"
actionName: config-assign
mode: sync
@@ -35,7 +35,7 @@ processes:
commonHeader: *commonHeader
actionIdentifiers: &deploy-ai
actionName: config-deploy
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config
blueprintVersion: "1.0.0"
mode: sync
payload:
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/activation-blueprint.json b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/pnf_config_aai.json
index 214f7dd75..e8a95d87f 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/activation-blueprint.json
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Definitions/pnf_config_aai.json
@@ -4,7 +4,7 @@
"template_author" : "Rahul Tyagi",
"author-email" : "rahul.tyagi@est.tech",
"user-groups" : "ADMIN, OPERATION",
- "template_name" : "configuration_over_restconf",
+ "template_name" : "pnf_config_aai",
"template_version" : "1.0.0",
"template_tags" : "pnf, restconf, config, configuration"
},
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/TOSCA-Metadata/TOSCA.meta
index 21f431861..903600836 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/TOSCA-Metadata/TOSCA.meta
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/TOSCA-Metadata/TOSCA.meta
@@ -1,7 +1,7 @@
TOSCA-Meta-File-Version: 1.0.0
CSAR-Version: 1.0
Created-By: Rahul Tyagi
-Entry-Definitions: Definitions/activation-blueprint.json
-Template-Name: activation-blueprint
+Entry-Definitions: Definitions/pnf_config_aai.json
+Template-Name: pnf_config_aai
Template-Version: 1.0.0
-Template-Tags: activation-blueprint
+Template-Tags: pnf_config_aai
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Tests/uat.yaml b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Tests/uat.yaml
index 1a5995e06..0692eea7f 100644
--- a/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Tests/uat.yaml
+++ b/components/model-catalog/blueprint-model/uat-blueprints/pnf_config_aai/Tests/uat.yaml
@@ -8,7 +8,7 @@ processes:
requestId: "123456-1000"
subRequestId: sub-123456-1000
actionIdentifiers: &assign-ai
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config_aai
blueprintVersion: "1.0.0"
actionName: config-assign
mode: sync
@@ -35,7 +35,7 @@ processes:
commonHeader: *commonHeader
actionIdentifiers: &deploy-ai
actionName: config-deploy
- blueprintName: configuration_over_restconf
+ blueprintName: pnf_config_aai
blueprintVersion: "1.0.0"
mode: sync
payload:
diff --git a/components/pom.xml b/components/pom.xml
new file mode 100644
index 000000000..fd19a4f5b
--- /dev/null
+++ b/components/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2018-2019 AT&T Intellectual Property.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.onap.ccsdk.cds</groupId>
+ <artifactId>parent</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <artifactId>components</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Components Root</name>
+ <description>Components</description>
+
+ <modules>
+ <module>model-catalog/blueprint-model</module>
+ </modules>
+</project>
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 6b1f186c9..91d51757a 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
@@ -110,35 +110,38 @@ open class ComponentRemotePythonExecutor(private val remoteScriptExecutionServic
)
val prepareEnvOutput = remoteScriptExecutionService.prepareEnv(prepareEnvInput)
log.info("$ATTRIBUTE_PREPARE_ENV_LOG - ${prepareEnvOutput.response}")
- val logs = JacksonUtils.jsonNodeFromObject(prepareEnvOutput.response)
- setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, logs)
- setAttribute(ATTRIBUTE_EXEC_CMD_LOG, "N/A".asJsonPrimitive())
+ val logs = prepareEnvOutput.response
+ val logsEnv = logs.toString().asJsonPrimitive()
+ setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, logsEnv)
if (prepareEnvOutput.status != StatusType.SUCCESS) {
- setNodeOutputErrors(prepareEnvOutput.status.name, logs)
+ setAttribute(ATTRIBUTE_EXEC_CMD_LOG, "N/A".asJsonPrimitive())
+ setNodeOutputErrors(prepareEnvOutput.status.name, logsEnv)
} else {
- setNodeOutputProperties(prepareEnvOutput.status.name.asJsonPrimitive(), logs, "".asJsonPrimitive())
+ setNodeOutputProperties(prepareEnvOutput.status.name.asJsonPrimitive(), logsEnv, "".asJsonPrimitive())
}
}
- // Populate command execution properties and pass it to the remote server
- val properties = dynamicProperties?.returnNullIfMissing()?.rootFieldsToMap() ?: hashMapOf()
-
- val remoteExecutionInput = RemoteScriptExecutionInput(
- requestId = processId,
- remoteIdentifier = RemoteIdentifier(blueprintName = blueprintName, blueprintVersion = blueprintVersion),
- command = scriptCommand,
- properties = properties)
- val remoteExecutionOutput = remoteScriptExecutionService.executeCommand(remoteExecutionInput)
-
- val logs = JacksonUtils.jsonNodeFromObject(remoteExecutionOutput.response)
- if (remoteExecutionOutput.status != StatusType.SUCCESS) {
- setNodeOutputErrors(remoteExecutionOutput.status.name,logs, remoteExecutionOutput.payload)
- } else {
- setNodeOutputProperties(remoteExecutionOutput.status.name.asJsonPrimitive(), logs,
- remoteExecutionOutput.payload)
+ // if Env preparation was successful, then proceed with command execution in this Env
+ if (bluePrintRuntimeService.getBluePrintError().errors.isEmpty()) {
+ // Populate command execution properties and pass it to the remote server
+ val properties = dynamicProperties?.returnNullIfMissing()?.rootFieldsToMap() ?: hashMapOf()
+
+ val remoteExecutionInput = RemoteScriptExecutionInput(
+ requestId = processId,
+ remoteIdentifier = RemoteIdentifier(blueprintName = blueprintName, blueprintVersion = blueprintVersion),
+ command = scriptCommand,
+ properties = properties)
+ val remoteExecutionOutput = remoteScriptExecutionService.executeCommand(remoteExecutionInput)
+
+ val logs = JacksonUtils.jsonNodeFromObject(remoteExecutionOutput.response)
+ if (remoteExecutionOutput.status != StatusType.SUCCESS) {
+ setNodeOutputErrors(remoteExecutionOutput.status.name, logs, remoteExecutionOutput.payload)
+ } else {
+ setNodeOutputProperties(remoteExecutionOutput.status.name.asJsonPrimitive(), logs,
+ remoteExecutionOutput.payload)
+ }
}
-
} catch (e: Exception) {
log.error("Failed to process on remote executor", e)
} finally {
@@ -178,9 +181,12 @@ open class ComponentRemotePythonExecutor(private val remoteScriptExecutionServic
*/
private fun setNodeOutputErrors(status: String, message: JsonNode, artifacts: JsonNode = "".asJsonPrimitive() ) {
setAttribute(ATTRIBUTE_EXEC_CMD_STATUS, status.asJsonPrimitive())
+ log.info("Executor status : $status")
setAttribute(ATTRIBUTE_EXEC_CMD_LOG, message)
+ log.info("Executor message : $message")
setAttribute(ATTRIBUTE_RESPONSE_DATA, artifacts)
+ log.info("Executor artifacts: $artifacts")
- addError(status, ATTRIBUTE_EXEC_CMD_LOG, message.asText())
+ addError(status, ATTRIBUTE_EXEC_CMD_LOG, message.toString())
}
}
diff --git a/ms/command-executor/src/main/python/command_executor_server.py b/ms/command-executor/src/main/python/command_executor_server.py
index 577c8a0ca..39cd1e6da 100644
--- a/ms/command-executor/src/main/python/command_executor_server.py
+++ b/ms/command-executor/src/main/python/command_executor_server.py
@@ -53,12 +53,12 @@ class CommandExecutorServer(CommandExecutor_pb2_grpc.CommandExecutorServiceServi
payload_result = {}
handler = CommandExecutorHandler(request)
payload_result = handler.execute_command(request, log_results)
- if not payload_result["cds_return_code"]:
+ if payload_result["cds_return_code"] != 0:
self.logger.info("{} - Failed to executeCommand. {}".format(blueprint_id, log_results))
else:
self.logger.info("{} - Execution finished successfully.".format(blueprint_id))
- ret = utils.build_response(request, log_results, payload_result, payload_result["cds_return_code"])
+ ret = utils.build_response(request, log_results, payload_result, payload_result["cds_return_code"] == 0)
self.logger.info("Payload returned %s" % payload_result)
return ret \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 856b6927d..d7580f0b0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2019 Bell Canada
+Modification Copyright © 2018-2019 AT&T Intellectual Property.
Unless otherwise specified, all software contained herein is licensed
under the Apache License, Version 2.0 (the License);
@@ -40,6 +41,7 @@ limitations under the License.
<modules>
<module>ms</module>
<module>cds-ui</module>
+ <module>components</module>
</modules>
<properties>