Remove debug output, fix logging in salt result checking
Change-Id: Ia2910916df5c2b174996125dd7fd1a0e878d902d
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index e6c0fe9..6164f5d 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -271,16 +271,15 @@
}
for (node in entry) {
for (resource in node.value) {
- println(String.format("resource = '%s'", resource))
def res = resource
if(resource instanceof Map.Entry){
res = resource.value
}
if(!res["result"] || (res["result"] instanceof String && res["result"] != "true")){
if (failOnError) {
- throw new Exception("Salt state on node ${node.key} failed: ${res}")
+ throw new Exception("Salt state on node ${node.key} failed: ${res}. State output: ${node.value}")
} else {
- common.errorMsg("Salt state on node ${node.key} failed: ${res}")
+ common.errorMsg("Salt state on node ${node.key} failed: ${res}. State output: ${node.value}")
}
}
}