diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2019-01-10 12:50:06 -0500 |
---|---|---|
committer | Singal, Kapil (ks220y) <ks220y@att.com> | 2019-01-11 10:08:58 -0500 |
commit | 5916e79bab772cc79765b0d8fedbc2de38e4ff4b (patch) | |
tree | facf49d89b2be30f2800c59404e9da2d8e00de00 /ms/blueprintsprocessor/functions/python-executor | |
parent | 6213aad62019a361126ee218b6b550e539e3582f (diff) |
Resource Resoulution Service
Implement Input Resource Resolution Processor Service along with Resource Resolution Utilities
Change-Id: Ibb4899e415f4b79cd6cd1b190b0f4969b09c3fe4
Issue-ID: CCSDK-936
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor')
3 files changed, 35 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtils.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtils.kt index 66c919d4..341ede58 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtils.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtils.kt @@ -20,6 +20,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.services.execution.AbstractCompon import org.python.core.PyObject import org.python.util.PythonInterpreter import org.slf4j.LoggerFactory +import java.io.File import java.util.* class PythonExecutorUtils { @@ -61,9 +62,9 @@ class PythonExecutorUtils { sb.append(System.getProperty("java.class.path")) for (p in pythonPath) { - sb.append(":").append(p) + sb.append(File.pathSeparator).append(p) } - log.debug("Paths : $sb") + log.debug("Python Paths : $sb") props["python.import.site"] = "true" props.setProperty("python.path", sb.toString()) diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtilsTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtilsTest.kt index 431c6b82..c4fd5467 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtilsTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtilsTest.kt @@ -30,7 +30,7 @@ class PythonExecutorUtilsTest { @Test fun testGetPythonComponent() { - val pythonPath: MutableList<String> = arrayListOf() + val pythonPath: MutableList<String> = mutableListOf() pythonPath.add("./../../../../components/scripts/python/ccsdk_blueprints") val properties: MutableMap<String, Any> = hashMapOf() diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/resources/requests/sample-activate-request.json b/ms/blueprintsprocessor/functions/python-executor/src/test/resources/requests/sample-activate-request.json new file mode 100644 index 00000000..7142f045 --- /dev/null +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/resources/requests/sample-activate-request.json @@ -0,0 +1,31 @@ +{
+ "actionIdentifiers": {
+ "actionName": "activate",
+ "blueprintName": "baseconfiguration",
+ "blueprintVersion": "1.0.0",
+ "mode": "sync"
+ },
+ "commonHeader": {
+ "flags": {
+ "force": true,
+ "ttl": 3600
+ },
+ "originatorId": "sdnc",
+ "requestId": "123456-1000",
+ "subRequestId": "sub-123456-1000",
+ "timestamp": "2012-04-23T18:25:43.511Z"
+ },
+ "payload": {
+ "resource-assignment-request": {
+ "resource-assignment-properties": {
+ "request-id": "1234",
+ "service-instance-id": "siid_1234",
+ "vnf-id": "vnf_1234",
+ "action-name": "assign-activate",
+ "scope-type": "vnf-type",
+ "hostname": "localhost",
+ "vnf_name": "temp_vnf"
+ }
+ }
+ }
+}
|