diff options
Diffstat (limited to 'ms/controllerblueprints')
2 files changed, 14 insertions, 8 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt index 5d84854e5..b822f00b8 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/FileExtensionFunctions.kt @@ -95,7 +95,7 @@ suspend fun File.reCreateNBDirs(): File = withContext(Dispatchers.IO) { reCreateDirs() } -suspend fun deleteNBDir(path: String, vararg more: String?) = withContext(Dispatchers.IO) { +suspend fun deleteNBDir(path: String, vararg more: String?): Boolean = withContext(Dispatchers.IO) { normalizedFile(path, *more).deleteRecursively() } diff --git a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintWorkflowEnhancerImpl.kt b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintWorkflowEnhancerImpl.kt index 8ea23136c..a8765eee1 100644 --- a/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintWorkflowEnhancerImpl.kt +++ b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/enhancer/BluePrintWorkflowEnhancerImpl.kt @@ -100,10 +100,10 @@ open class BluePrintWorkflowEnhancerImpl(private val bluePrintRepoService: BlueP when { derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_COMPONENT, true) -> { - // DO Nothing + enhanceStepTargets(name, workflow, firstNodeTemplateName, false) } derivedFrom.startsWith(BluePrintConstants.MODEL_TYPE_NODE_WORKFLOW, true) -> { - enhanceDGStepTargets(name, workflow, firstNodeTemplateName) + enhanceStepTargets(name, workflow, firstNodeTemplateName, true) } else -> { throw BluePrintProcessorException("couldn't execute workflow($name) step mapped " + @@ -113,15 +113,21 @@ open class BluePrintWorkflowEnhancerImpl(private val bluePrintRepoService: BlueP } - private fun enhanceDGStepTargets(name: String, workflow: Workflow, dgNodeTemplateName: String) { + private fun enhanceStepTargets(name: String, workflow: Workflow, nodeTemplateName: String, isDG: Boolean) { - val dgNodeTemplate = bluePrintContext.nodeTemplateByName(dgNodeTemplateName) + val dependencyNodeTemplates: List<String> + if (isDG) { + val dgNodeTemplate = bluePrintContext.nodeTemplateByName(nodeTemplateName) - // Get the Dependent Component Node Template Names - val dependencyNodeTemplateNodes = dgNodeTemplate.properties?.get(PROPERTY_DEPENDENCY_NODE_TEMPLATES) + // Get the Dependent Component Node Template Names + val dependencyNodeTemplateNodes = dgNodeTemplate.properties?.get(PROPERTY_DEPENDENCY_NODE_TEMPLATES) ?: throw BluePrintException("couldn't get property($PROPERTY_DEPENDENCY_NODE_TEMPLATES) ") - val dependencyNodeTemplates = JacksonUtils.getListFromJsonNode(dependencyNodeTemplateNodes, String::class.java) + dependencyNodeTemplates = + JacksonUtils.getListFromJsonNode(dependencyNodeTemplateNodes, String::class.java) + } else { + dependencyNodeTemplates = listOf(nodeTemplateName) + } log.info("workflow($name) dependent component NodeTemplates($dependencyNodeTemplates)") |