aboutsummaryrefslogtreecommitdiffstats
path: root/tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt')
-rw-r--r--tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt19
1 files changed, 12 insertions, 7 deletions
diff --git a/tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt b/tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt
index 77d86d04..f925be06 100644
--- a/tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt
+++ b/tutorials/ApacheCNF/templates/cba/Scripts/kotlin/ConfigDeploySetup.kt
@@ -70,17 +70,22 @@ open class ConfigDeploySetup() : ResourceAssignmentProcessor() {
}
}
} else if (executionRequest.name == "replica-count") {
- var value = raRuntimeService.getInputValue(executionRequest.name)
retValue = "1"
- if (!value.isNullOrMissing()) {
- retValue = value.asText()
- } else {
- value = raRuntimeService.getInputValue("data")
+ try {
+ var value = raRuntimeService.getInputValue(executionRequest.name)
if (!value.isNullOrMissing()) {
- if (value["replicaCount"] != null) {
- retValue = value["replicaCount"].asText()
+ retValue = value.asText()
+ } else {
+ value = raRuntimeService.getInputValue("data")
+ if (!value.isNullOrMissing()) {
+ if (value["replicaCount"] != null) {
+ retValue = value["replicaCount"].asText()
+ }
}
}
+ } catch (e: Exception) {
+ log.error(e.message, e)
+ log.info("Setting default replica count: 1")
}
} else if (executionRequest.name == "config-deploy-setup") {
val modulesSdnc = raRuntimeService.getResolutionStore("vf-modules-list-sdnc")["vf-modules"]