Merge pull request #26787 from jfindlay/imp

merge #26775
This commit is contained in:
Justin Findlay 2015-08-31 11:52:45 -06:00
commit 70d0268c83
3 changed files with 8 additions and 7 deletions

View file

@ -7,6 +7,7 @@ from salt.utils import parsers
from salt.utils.verify import verify_env, verify_files
from salt.config import _expand_glob_path
import salt.cli.caller
import salt.defaults.exitcodes
class SaltCall(parsers.SaltCallOptionParser):
@ -60,10 +61,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

@ -2,11 +2,10 @@
from __future__ import print_function
from __future__ import absolute_import
import os
from salt.utils import parsers
from salt.utils.verify import check_user, verify_env, verify_files
from salt.exceptions import SaltClientError
import salt.defaults.exitcodes # pylint: disable=W0611
class SaltRun(parsers.SaltRunOptionParser):
@ -45,7 +44,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,11 +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):
@ -146,7 +147,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):