summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/python-executor/src
diff options
context:
space:
mode:
authorSingal, Kapil (ks220y) <ks220y@att.com>2019-01-10 12:50:06 -0500
committerSingal, Kapil (ks220y) <ks220y@att.com>2019-01-11 10:08:58 -0500
commit636bf03c2a813c889921ff9a223f23e623532e69 (patch)
tree440eff81e7fd67110ae4c64940f59e06d0914789 /ms/blueprintsprocessor/functions/python-executor/src
parent3370454b30569f434a099973e1b63dc7142928f9 (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/src')
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtils.kt5
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/utils/PythonExecutorUtilsTest.kt2
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/test/resources/requests/sample-activate-request.json31
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 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<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 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"
+ }
+ }
+ }
+}