Switch errors for warnings and exit 1 for exit 0 on some edge cases.

Warn the users when nothing is going to be installed and `exit 0`.
Warn the users when nothing was configured and it was supposed to configure, then `exit 0`.
This simplifies other applications using the script, namely salty-vagrant.
This commit is contained in:
Pedro Algarvio 2013-03-06 23:10:51 +00:00
parent 83fb7ce384
commit c81e40b89a

View file

@ -205,8 +205,8 @@ __check_unparsed_options() {
# Check that we're actually installing one of minion/master/syndic
if [ $INSTALL_MINION -eq $BS_FALSE ] && [ $INSTALL_MASTER -eq $BS_FALSE ] && [ $INSTALL_SYNDIC -eq $BS_FALSE ] && [ $CONFIG_ONLY -eq $BS_FALSE ]; then
echoerror "Nothing to install or configure"
exit 1
echowarn "Nothing to install or configure"
exit 0
fi
if [ $CONFIG_ONLY -eq $BS_TRUE ] && [ "$TEMP_CONFIG_DIR" = "null" ]; then
@ -2021,8 +2021,8 @@ config_salt() {
fi
if [ $CONFIG_ONLY -eq $BS_TRUE ] && [ $CONFIGURED_ANYTHING -eq $BS_FALSE ]; then
echoerror "No configuration or keys were copied over. No configuration was done!"
exit 1
echowarn "No configuration or keys were copied over. No configuration was done!"
exit 0
fi
}
#