mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix some non portable exitcodes. Fixes #26773
This commit is contained in:
parent
46a4bbd0e7
commit
7bd8809e23
3 changed files with 6 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue