mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Clean up stacktrace when referenced map file doesn't exist
This commit is contained in:
parent
823f0ce350
commit
3aa5045138
2 changed files with 9 additions and 5 deletions
|
@ -1648,11 +1648,11 @@ class Map(Cloud):
|
|||
return {}
|
||||
|
||||
if not os.path.isfile(self.opts['map']):
|
||||
raise SaltCloudNotFound(
|
||||
'The specified map file does not exist: {0}\n'.format(
|
||||
self.opts['map']
|
||||
)
|
||||
log.error(
|
||||
'The specified map file does not exist: \'{0}\''.format(
|
||||
self.opts['map'])
|
||||
)
|
||||
raise SaltCloudNotFound()
|
||||
try:
|
||||
renderer = self.opts.get('renderer', 'yaml_jinja')
|
||||
rend = salt.loader.render(self.opts, {})
|
||||
|
|
|
@ -83,7 +83,11 @@ class SaltCloud(parsers.SaltCloudParser):
|
|||
self.exit(salt.defaults.exitcodes.EX_OK)
|
||||
|
||||
log.info('salt-cloud starting')
|
||||
mapper = salt.cloud.Map(self.config)
|
||||
try:
|
||||
mapper = salt.cloud.Map(self.config)
|
||||
except SaltCloudException as exc:
|
||||
msg = 'There was an error generating the mapper.'
|
||||
self.handle_exception(msg, exc)
|
||||
|
||||
names = self.config.get('names', None)
|
||||
if names is not None:
|
||||
|
|
Loading…
Add table
Reference in a new issue