Fix, avoid set -e during services restart
Change-Id: I9f4a8d4f6ae382f7023363b7841391161e4b685b
diff --git a/bootstrap.sh b/bootstrap.sh
index 42aae48..48eecac 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -570,6 +570,7 @@
}
saltservice_stop() {
+ set +e
$SUDO service salt-minion stop
$SUDO service salt-master stop
sleep ${SALT_STOPSTART_WAIT:-30}
@@ -577,12 +578,14 @@
${SUDO} pkill -9 salt-minion
}
saltservice_start() {
+ set +e
$SUDO service salt-master start
$SUDO service salt-minion start
sleep ${SALT_STOPSTART_WAIT:-30}
}
saltservice_restart() {
+ set +e
saltservice_stop
saltservice_start
}
@@ -671,8 +674,8 @@
# FIXME: PLACEHOLDER TO TRIGGER NODE GENERATION THROUG SALT REACT.
retry ${SALT_STATE_RETRY} $SUDO salt-call ${SALT_OPTS} state.apply reclass.storage.node
ret=$?
- set -e
+ set -e
if [[ $ret -eq 2 ]]; then
log_err "State reclass.storage.node failed with exit code 2 but continuing."
elif [[ $ret -ne 0 ]]; then
@@ -680,13 +683,17 @@
exit 1
fi
- log_info "Re/starting salt services"
+ set +e
+ log_info "Updating minion.conf -> master: localhost"
$SUDO sed -i 's/^master:.*/master: localhost/' /etc/salt/minion.d/minion.conf
+
+ log_info "Re/starting salt services" # in order to load new deployed configuration from model
saltservice_restart
+
+ log_info "Salt Util sync all"
$SUDO salt-call ${SALT_OPTS} saltutil.sync_all >/dev/null
verify_salt_master
- set +e
}