aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/netconf-executor
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/functions/netconf-executor')
-rw-r--r--ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt17
-rw-r--r--ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/logback-test.xml2
2 files changed, 9 insertions, 10 deletions
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
index 2980de98a..663daf54e 100644
--- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
+++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt
@@ -24,7 +24,6 @@ import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.Reso
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
import org.onap.ccsdk.cds.controllerblueprints.core.getAsString
-import org.slf4j.LoggerFactory
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import org.springframework.context.annotation.Scope
import org.springframework.stereotype.Component
@@ -34,18 +33,15 @@ import org.springframework.stereotype.Component
open class ComponentNetconfExecutor(private var componentFunctionScriptingService: ComponentFunctionScriptingService)
: AbstractComponentFunction() {
- private val log = LoggerFactory.getLogger(ComponentNetconfExecutor::class.java)
-
companion object {
const val SCRIPT_TYPE = "script-type"
const val SCRIPT_CLASS_REFERENCE = "script-class-reference"
const val INSTANCE_DEPENDENCIES = "instance-dependencies"
}
-
lateinit var scriptComponent: NetconfComponentFunction
- override fun process(executionRequest: ExecutionServiceInput) {
+ override suspend fun processNB(executionRequest: ExecutionServiceInput) {
val scriptType = operationInputs.getAsString(SCRIPT_TYPE)
val scriptClassReference = operationInputs.getAsString(SCRIPT_CLASS_REFERENCE)
@@ -64,12 +60,13 @@ open class ComponentNetconfExecutor(private var componentFunctionScriptingServic
checkNotNull(scriptComponent) { "failed to get netconf script component" }
- scriptComponent.process(executionServiceInput)
- }
-
- override fun recover(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
- scriptComponent.recover(runtimeException, executionRequest)
+ // Handles both script processing and error handling
+ scriptComponent.executeScript(executionServiceInput)
}
+ override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) {
+ bluePrintRuntimeService.getBluePrintError()
+ .addError("Failed in ComponentNetconfExecutor : ${runtimeException.message}")
+ }
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/logback-test.xml b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/logback-test.xml
index 355cd3ace..cc7ac83ad 100644
--- a/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/logback-test.xml
+++ b/ms/blueprintsprocessor/functions/netconf-executor/src/test/resources/logback-test.xml
@@ -26,7 +26,9 @@
<logger name="org.springframework.test" level="warn"/>
<logger name="org.springframework" level="warn"/>
<logger name="org.hibernate" level="info"/>
+ <logger name="org.apache.sshd" level="warn"/>
<logger name="org.onap.ccsdk.cds.blueprintsprocessor" level="info"/>
+ <logger name="org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.core" level="warn"/>
<root level="warn">
<appender-ref ref="STDOUT"/>