Fix enforceStateWithTest to not result in Error in case of missing optional param
Change-Id: Ib85c301ef73e0d66baff1603b276b17e1cae3e27
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index e2f4189..2273ebd 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -189,9 +189,10 @@
return enforceState(saltId, target, state, output, failOnError, batch, false, read_timeout, retries, queue, saltArgs)
} else {
if (!optional) {
- throw new Exception("No Minions matched the target matcher: ${testTargetMatcher}.")
+ common.infoMsg("No Minions matched the target matcher: ${testTargetMatcher}, and 'optional' param was set to false. - This may signify missing pillar definition!!")
+// throw new Exception("No Minions matched the target matcher: ${testTargetMatcher}.") TODO: Change the infoMsg to Error once the methods are changed to Use named params and optional param will be set globally
} else {
- common.infoMsg("No Minions matched the target given, but 'optional' param was set to true - Pipeline continues. ")
+ common.infoMsg("No Minions matched the target matcher: ${testTargetMatcher}, but 'optional' param was set to true - Pipeline continues. ")
}
}
}