diff options
author | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-06-18 19:43:50 -0400 |
---|---|---|
committer | Alexis de Talhouët <adetalhouet89@gmail.com> | 2019-06-21 01:10:53 +0000 |
commit | 7ad72c86fbd10888a849eed2b00dc9fddadef5aa (patch) | |
tree | 28ea065a77e3ce60b14603b86748aeed87f9d80b /ms/blueprintsprocessor/functions | |
parent | 091bba704d8e9137b9bca9ed02d139539aa2ac53 (diff) |
Add Jinja2 custom ResourceLocator
This will allow to include template within template to create
template hierarchy
Change-Id: I21c5deaf51d391e1a51b9863a905c26b1891db16
Issue-ID: CCSDK-1417
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
3 files changed, 4 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt index c7f35f7c8..1b84964e8 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/cli/executor/CliComponentFunction.kt @@ -41,12 +41,6 @@ abstract class CliComponentFunction : AbstractScriptComponentFunction() { return file.readNBLines() } - suspend fun generateMessage(artifactName: String, json: String): String { - val templateService = BluePrintTemplateService() - return templateService.generateContent(bluePrintRuntimeService, nodeTemplateName, artifactName, json, true) - } - - fun generateMessage(artifactName: String): String { return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName) } diff --git a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts index 18d4a4797..0955ace79 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts +++ b/ms/blueprintsprocessor/functions/cli-executor/src/main/kotlin/scripts/InternalSimpleCli.cba.kts @@ -20,6 +20,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInpu import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.CliComponentFunction import org.onap.ccsdk.cds.blueprintsprocessor.functions.cli.executor.ComponentCliExecutor import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive +import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintTemplateService import org.slf4j.LoggerFactory open class TestCliScriptFunction : CliComponentFunction() { diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt index ebff47899..fe5906220 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionService.kt @@ -59,7 +59,8 @@ interface ResourceResolutionService { @Service(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION) open class ResourceResolutionServiceImpl(private var applicationContext: ApplicationContext, - private var resolutionResultService: ResourceResolutionResultService) : + private var resolutionResultService: ResourceResolutionResultService, + private var blueprintTemplateService: BluePrintTemplateService) : ResourceResolutionService { private val log = LoggerFactory.getLogger(ResourceResolutionService::class.java) @@ -137,7 +138,6 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica // Check Template is there if (artifactTemplate != null) { - val blueprintTemplateService = BluePrintTemplateService() resolvedContent = blueprintTemplateService.generateContent(bluePrintRuntimeService, nodeTemplateName, artifactTemplate, resolvedParamJsonContent) @@ -189,6 +189,7 @@ open class ResourceResolutionServiceImpl(private var applicationContext: Applica // Set errors from RA blueprintRuntimeService.setBluePrintError(resourceAssignmentRuntimeService.getBluePrintError()) } catch (e: RuntimeException) { + log.error("Fail in processing ${resourceAssignment.name}", e) throw BluePrintProcessorException(e) } } |