summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2020-06-30 13:58:50 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-30 13:58:50 +0000
commit6f2dc6baf3eac886095597b007a62f77ff836495 (patch)
tree5de8395cacce4503c1eddc0c3a5562177d7e456b
parentfbbdf23b57c799362a368a98ae53290d5dc48909 (diff)
parent273290a67a102a6b2da7cfc5407871c52fa126ee (diff)
Merge "RemoteAnsibleExecutor delay vs Thread.sleep bug"
-rw-r--r--ms/blueprintsprocessor/functions/ansible-awx-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/ansible/executor/ComponentRemoteAnsibleExecutor.kt5
1 files changed, 3 insertions, 2 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 6f994edab..1e70cdd9e 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
@@ -20,6 +20,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.TextNode
+import kotlinx.coroutines.delay
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
@@ -172,7 +173,7 @@ open class ComponentRemoteAnsibleExecutor(
* its execution. Finally, it retrieves the job results via the stdout api.
* The status and output attributes are populated in the process.
*/
- private fun runJobTemplateOnAWX(
+ private suspend fun runJobTemplateOnAWX(
awxClient: BlueprintWebClientService,
job_template_name: String?,
jtId: String,
@@ -210,7 +211,7 @@ open class ComponentRemoteAnsibleExecutor(
val jobLaunched: JsonNode = mapper.readTree(response.body)
jobStatus = jobLaunched.at("/status").asText()
jobEndTime = jobLaunched.at("/finished").asText()
- Thread.sleep(checkDelay)
+ delay(checkDelay)
}
log.info("Execution of job template $job_template_name in job #$jobId finished with status ($jobStatus) for requestId $processId")