mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Cover exception handling in the utils.parsers
This commit is contained in:
parent
2cf696671f
commit
575767022b
@ -38,6 +38,7 @@ import salt.utils.jid
|
||||
from salt.utils import kinds
|
||||
from salt.defaults import DEFAULT_TARGET_DELIM
|
||||
from salt.utils.validate.path import is_writeable
|
||||
import salt.exceptions
|
||||
|
||||
# Import 3rd-party libs
|
||||
import salt.ext.six as six
|
||||
@ -385,7 +386,12 @@ class SaltfileMixIn(six.with_metaclass(MixInMeta, object)):
|
||||
'Loading Saltfile from \'{0}\''.format(self.options.saltfile)
|
||||
)
|
||||
|
||||
try:
|
||||
saltfile_config = config._read_conf_file(saltfile)
|
||||
except salt.exceptions.SaltConfigurationError as error:
|
||||
self.error(error.message)
|
||||
self.exit(salt.defaults.exitcodes.EX_GENERIC,
|
||||
'{0}: error: {1}\n'.format(self.get_prog_name(), error.message))
|
||||
|
||||
if not saltfile_config:
|
||||
# No configuration was loaded from the Saltfile
|
||||
|
Loading…
Reference in New Issue
Block a user