Fix some non portable exitcodes. Fixes #26773

This commit is contained in:
Anton D 2015-08-30 21:33:29 +12:00
parent 46a4bbd0e7
commit 7bd8809e23
3 changed files with 6 additions and 6 deletions

View file

@ -60,10 +60,10 @@ class SaltCall(parsers.SaltCallOptionParser):
if self.options.doc:
caller.print_docs()
self.exit(os.EX_OK)
self.exit(salt.defaults.exitcodes.EX_OK)
if self.options.grains_run:
caller.print_grains()
self.exit(os.EX_OK)
self.exit(salt.defaults.exitcodes.EX_OK)
caller.run()

View file

@ -45,7 +45,7 @@ class SaltRun(parsers.SaltRunOptionParser):
runner = salt.runner.Runner(self.config)
if self.options.doc:
runner.print_docs()
self.exit(os.EX_OK)
self.exit(salt.defaults.exitcodes.EX_OK)
# Run this here so SystemExit isn't raised anywhere else when
# someone tries to use the runners via the python API

View file

@ -21,12 +21,12 @@ import subprocess
THIN_ARCHIVE = 'salt-thin.tgz'
EXT_ARCHIVE = 'salt-ext_mods.tgz'
# Keep these in sync with salt/exitcodes.py
# Keep these in sync with salt/defaults/exitcodes.py
EX_THIN_DEPLOY = 11
EX_THIN_CHECKSUM = 12
EX_MOD_DEPLOY = 13
EX_SCP_NOT_FOUND = 14
EX_CANTCREAT = 73
class OBJ(object):
"""An empty class for holding instance attribute values."""
@ -146,7 +146,7 @@ def main(argv): # pylint: disable=W0613
'ERROR: salt path "{0}" exists but is'
' not a directory\n'.format(OPTIONS.saltdir)
)
sys.exit(os.EX_CANTCREAT)
sys.exit(EX_CANTCREAT)
version_path = os.path.join(OPTIONS.saltdir, 'version')
if not os.path.exists(version_path) or not os.path.isfile(version_path):