Merge pull request #13691 from cachedout/exit_codes

Migrate minion to centralized exit codes
This commit is contained in:
Thomas S Hatch 2014-06-24 21:28:00 -06:00
commit 35f21641a8

View File

@ -65,6 +65,7 @@ import salt.utils
import salt.utils.args
import salt.utils.event
import salt.utils.schedule
import salt.exitcodes
from salt._compat import string_types
from salt.utils.debug import enable_sigusr1_handler
@ -675,7 +676,7 @@ class Minion(MinionBase):
msg = ('Failed to evaluate master address from '
'module \'{0}\''.format(opts['master']))
log.error(msg)
sys.exit(1)
sys.exit(salt.exitcodes.EX_GENERIC)
log.info('Evaluated master from module: {0}'.format(master_mod))
# if failover is set, master has to be of type list
@ -701,12 +702,12 @@ class Minion(MinionBase):
'is not of type list but of type '
'{0}'.format(type(opts['master'])))
log.error(msg)
sys.exit(1)
sys.exit(salt.exitcodes.EX_GENERIC)
else:
msg = ('Invalid keyword \'{0}\' for variable '
'\'master_type\''.format(opts['master_type']))
log.error(msg)
sys.exit(1)
sys.exit(salt.exitcodes.EX_GENERIC)
# if we have a list of masters, loop through them and be
# happy with the first one that allows us to connect
@ -748,7 +749,7 @@ class Minion(MinionBase):
msg = ('master {0} rejected the minions connection because too '
'many minions are already connected.'.format(opts['master']))
log.error(msg)
sys.exit(1)
sys.exit(salt.exitcodes.EX_GENERIC)
else:
return opts['master']