summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/ansible-awx-executor/src
diff options
context:
space:
mode:
authorSerge Simard <serge@agilitae.com>2019-06-12 10:06:24 -0400
committerSerge Simard <serge@agilitae.com>2019-06-13 00:45:32 -0400
commit39167cccae3271603819aa39c6476e434c759533 (patch)
tree31dcacd8dd7409f3ee1cf6eb842991d70f678e94 /ms/blueprintsprocessor/functions/ansible-awx-executor/src
parentbe4979c8ebd5e9df53b59dbca32d9703794fc500 (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/ansible-awx-executor/src')
-rw-r--r--ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt7
1 files changed, 6 insertions, 1 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()
}