Simplified ASK_ON_ERROR handling
Change-Id: I37f628b079cca1840346feb25835404d203835d4
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index 4b83d33..52e77e8 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -267,12 +267,6 @@
*/
def checkResult(result, failOnError = true) {
def common = new com.mirantis.mk.Common()
- def askOnError = false
- try {
- askOnError = env.ASK_ON_ERROR
- } catch (MissingPropertyException e) {
- askOnError = false
- }
if(result != null){
if(result['return']){
for (int i=0;i<result['return'].size();i++) {
@@ -298,7 +292,7 @@
resource = node[resKey]
common.debugMsg("checkResult: checking resource: ${resource}")
if(resource instanceof String || !resource["result"] || (resource["result"] instanceof String && resource["result"] != "true")){
- if(askOnError){
+ if(env["ASK_ON_ERROR"] && env["ASK_ON_ERROR"] == "true"){
def prettyResource = common.prettyPrint(resource)
timeout(time:1, unit:'HOURS') {
input message: "False result on ${nodeKey} found, resource ${prettyResource}. \nDo you want to continue?"