diff options
author | Serge Simard <serge@agilitae.com> | 2019-06-12 10:06:24 -0400 |
---|---|---|
committer | Serge Simard <serge@agilitae.com> | 2019-06-13 00:45:32 -0400 |
commit | 39167cccae3271603819aa39c6476e434c759533 (patch) | |
tree | 31dcacd8dd7409f3ee1cf6eb842991d70f678e94 /ms/blueprintsprocessor/functions | |
parent | be4979c8ebd5e9df53b59dbca32d9703794fc500 (diff) |
Various bug fixes encountered during remote ansible executor development.
- Upload CBA sometimes failed because Property files were left opened.
- Default value were ignored on datatype elements.
- Various erroneous error messages
- Fixed job template lookup by name encoding when name contains blanks.
Issue-ID: CCSDK-1357
Signed-off-by: Serge Simard <serge@agilitae.com>
Change-Id: If9d4b0339d647e6c99121f5464a1b6da787761a0
Signed-off-by: Serge Simard <serge@agilitae.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions')
4 files changed, 9 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt index 96a7bb712..f145d9677 100644 --- a/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt +++ b/ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt @@ -19,6 +19,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.ansible.executor import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.node.ObjectNode +import java.net.URI import java.net.URLEncoder import java.util.NoSuchElementException import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.* @@ -132,8 +133,12 @@ open class ComponentRemoteAnsibleExecutor(private val blueprintRestLibPropertySe private fun lookupJobTemplateIDByName(awxClient : BlueprintWebClientService, job_template_name: String?): String { val mapper = ObjectMapper() + val encodedJTName = URI(null,null, + "/api/v2/job_templates/${job_template_name}/", + null,null).rawPath + // Get Job Template details by name - var response = awxClient.exchangeResource(GET, "/api/v2/job_templates/${job_template_name}/", "") + var response = awxClient.exchangeResource(GET, encodedJTName,"") val jtDetails: JsonNode = mapper.readTree(response.body) return jtDetails.at("/id").asText() } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt index 1a7c50676..7a8d6ec5c 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/CapabilityResourceResolutionProcessor.kt @@ -81,7 +81,7 @@ open class CapabilityResourceResolutionProcessor(private val applicationContext: override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) { raRuntimeService.getBluePrintError() - .addError("Failed in ComponentNetconfExecutor : ${runtimeException.message}") + .addError("Failed in CapabilityResourceResolutionProcessor : ${runtimeException.message}") } suspend fun scriptInstance(scriptType: String, scriptClassReference: String, instanceDependencies: List<String>) diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt index 1cc44a2cb..39ffe5ea9 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/processor/ResourceAssignmentProcessor.kt @@ -121,7 +121,7 @@ abstract class ResourceAssignmentProcessor : BlueprintFunctionNode<ResourceAssig try { process(resourceAssignment) } catch (runtimeException: RuntimeException) { - log.error("failed in ${getName()} : ${runtimeException.message}", runtimeException) + log.error("failed in ResourceAssignmentProcessor : ${runtimeException.message}", runtimeException) recover(runtimeException, resourceAssignment) } } diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt index 1a943d110..8a8bfbf32 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt +++ b/ms/blueprintsprocessor/functions/resource-resolution/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtils.kt @@ -70,7 +70,7 @@ class ResourceAssignmentUtils { try { if (resourceProp.type.isNotEmpty()) { logger.info("Setting Resource Value ($value) for Resource Name " + - "(${resourceAssignment.dictionaryName}) of type (${resourceProp.type})") + "(${resourceAssignment.name}) of type (${resourceProp.type})") setResourceValue(resourceAssignment, raRuntimeService, value) resourceAssignment.updatedDate = Date() resourceAssignment.updatedBy = BluePrintConstants.USER_SYSTEM |