Use handle_exception function in cloud cli.py

This commit is contained in:
rallytime 2015-07-28 17:18:05 -06:00
parent f91edf3a33
commit 3f3005c746

View File

@ -197,8 +197,9 @@ class SaltCloud(parsers.SaltCloudParser):
log.info('Applying map from {0!r}.'.format(self.config['map']))
try:
names = mapper.get_vmnames_by_action(self.options.action)
except SaltCloudException:
return []
except SaltCloudException as exc:
msg = 'There was an error actioning virtual machines.'
self.handle_exception(msg, exc)
else:
names = self.config.get('names', None)