2 * Copyright © 2017-2018 AT&T Intellectual Property.
4 * Modifications Copyright © 2019 IBM, Bell Canada.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.scripts
21 import org.springframework.beans.factory.annotation.Value
22 import org.springframework.boot.context.properties.EnableConfigurationProperties
23 import org.springframework.context.annotation.ComponentScan
24 import org.springframework.context.annotation.Configuration
26 import java.util.Properties
28 @Deprecated("CDS won't support JythonService")
31 @EnableConfigurationProperties
32 open class PythonExecutorConfiguration
34 @Deprecated("CDS won't support JythonService")
36 open class PythonExecutorProperty {
38 @Value("\${blueprints.processor.functions.python.executor.executionPath}")
39 lateinit var executionPath: String
41 @Value("#{'\${blueprints.processor.functions.python.executor.modulePaths}'.split(',')}")
42 lateinit var modulePaths: List<String>
45 @Deprecated("CDS won't support JythonService")
46 class PythonExecutorConstants {
50 const val INPUT_INSTANCE_DEPENDENCIES = "instance-dependencies"
54 @Deprecated("CDS won't support JythonService")
55 open class BlueprintPython(
56 executablePath: String,
57 blueprintPythonPlatform: MutableList<String>,
58 val argv: MutableList<String>
61 lateinit var moduleName: String
62 lateinit var pythonClassName: String
63 lateinit var content: String
64 var props: Properties = Properties()
67 // Build up the python.path
68 val sb = StringBuilder()
69 sb.append(System.getProperty("java.class.path"))
71 for (p in blueprintPythonPlatform) {
72 sb.append(File.pathSeparator).append(p)
75 props["python.import.site"] = "true"
76 props.setProperty("python.path", sb.toString())
77 props.setProperty("python.verbose", "error")
78 props.setProperty("python.executable", executablePath)