Merge pull request #28214 from rallytime/fix_boto_route53_stacktrace

Don't stacktrace if invalid credentials are passed to boto_route53 state
This commit is contained in:
Mike Place 2015-10-23 07:37:30 -06:00
commit f269f40905

View File

@ -71,6 +71,12 @@ passed in as a dict, or as a string to pull from pillars or minion config:
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Libs
from salt.utils import SaltInvocationError
def __virtual__():
'''
@ -144,10 +150,15 @@ def present(
if isinstance(value, list):
value = ','.join(value)
record = __salt__['boto_route53.get_record'](name, zone, record_type,
False, region, key, keyid,
profile, split_dns,
private_zone)
try:
record = __salt__['boto_route53.get_record'](name, zone, record_type,
False, region, key, keyid,
profile, split_dns,
private_zone)
except SaltInvocationError as err:
ret['comment'] = 'Error: {0}'.format(err)
ret['result'] = False
return ret
if isinstance(record, dict) and not record:
if __opts__['test']: