From 39167cccae3271603819aa39c6476e434c759533 Mon Sep 17 00:00:00 2001 From: Serge Simard Date: Wed, 12 Jun 2019 10:06:24 -0400 Subject: 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 Change-Id: If9d4b0339d647e6c99121f5464a1b6da787761a0 Signed-off-by: Serge Simard --- .../functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/functions/ansible-awx-executor/src') 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() } -- cgit 1.2.3-korg