Fix cmd and waitState declaration
Make cmd and waitState variables available in method
local scope.
Change-Id: I94554a3d281a7b170476e81b3e7c9ee6c8bd5e99
Related-Prod: PROD-14252
diff --git a/src/com/mirantis/mk/Openstack.groovy b/src/com/mirantis/mk/Openstack.groovy
index bd21370..8348612 100644
--- a/src/com/mirantis/mk/Openstack.groovy
+++ b/src/com/mirantis/mk/Openstack.groovy
@@ -179,12 +179,15 @@
createHeatEnv(envFile, params)
}
+ def cmd
+ def waitState
+
if (action == "create") {
- def cmd = "heat stack-create -f ${templateFile} -e ${envFile} ${name}"
- def waitState = "CREATE_COMPLETE"
+ cmd = "heat stack-create -f ${templateFile} -e ${envFile} ${name}"
+ waitState = "CREATE_COMPLETE"
} else {
- def cmd = "heat stack-update -f ${templateFile} -e ${envFile} ${name}"
- def waitState = "UPDATE_COMPLETE"
+ cmd = "heat stack-update -f ${templateFile} -e ${envFile} ${name}"
+ waitState = "UPDATE_COMPLETE"
}
dir("${env.WORKSPACE}/template/template") {