From 636bf03c2a813c889921ff9a223f23e623532e69 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Thu, 10 Jan 2019 12:50:06 -0500 Subject: 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) --- .../python/executor/utils/PythonExecutorUtils.kt | 5 ++-- .../executor/utils/PythonExecutorUtilsTest.kt | 2 +- .../requests/sample-activate-request.json | 31 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 ms/blueprintsprocessor/functions/python-executor/src/test/resources/requests/sample-activate-request.json (limited to 'ms/blueprintsprocessor/functions/python-executor') 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 66c919d4d..341ede585 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 431c6b820..c4fd54673 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 = arrayListOf() + val pythonPath: MutableList = mutableListOf() pythonPath.add("./../../../../components/scripts/python/ccsdk_blueprints") val properties: MutableMap = 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 000000000..7142f0457 --- /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" + } + } + } +} -- cgit 1.2.3-korg