print info about salt actions
Change-Id: I4ad94d33a10d90d6835b096e0498b55214c3e934
diff --git a/src/com/mirantis/mk/Salt.groovy b/src/com/mirantis/mk/Salt.groovy
index 5361887..52b70dc 100644
--- a/src/com/mirantis/mk/Salt.groovy
+++ b/src/com/mirantis/mk/Salt.groovy
@@ -12,7 +12,7 @@
* @param credentialsID ID of credentials store entry
*/
def connection(url, credentialsId = "salt") {
- def common = new com.mirantis.mk.Common();
+ def common = new com.mirantis.mk.Common()
params = [
"url": url,
"credentialsId": credentialsId,
@@ -88,13 +88,17 @@
}
def enforceState(master, target, state, output = false) {
+ def common = new com.mirantis.mk.Common()
def run_states
+
if (state instanceof String) {
run_states = state
} else {
run_states = state.join(',')
}
+ common.infoMsg('Enforcing state ${run_states} on ${target}')
+
def out = runSaltCommand(master, 'local', ['expression': target, 'type': 'compound'], 'state.sls', null, [run_states])
try {
@@ -108,6 +112,10 @@
}
def cmdRun(master, target, cmd) {
+ def common = new com.mirantis.mk.Common()
+
+ common.infoMsg('Running command ${cmd} on ${target}')
+
def out = runSaltCommand(master, 'local', ['expression': target, 'type': 'compound'], 'cmd.run', null, [cmd])
return out
}
@@ -145,8 +153,11 @@
}
def runSaltProcessStep(master, tgt, fun, arg = [], batch = null, output = true) {
+ def common = new com.mirantis.mk.Common()
def out
+ common.infoMsg('Running step ${fun} on ${tgt}')
+
if (batch) {
out = runSaltCommand(master, 'local_batch', ['expression': tgt, 'type': 'compound'], fun, String.valueOf(batch), arg)
} else {