Don't stacktrace if invalid credentials are passed to boto_route53 state

This commit is contained in:
rallytime 2015-10-22 11:22:41 -06:00
parent 36dc12c62c
commit 11c475b0ad

View File

@ -71,6 +71,8 @@ passed in as a dict, or as a string to pull from pillars or minion config:
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
'''
# Import Salt Libs
from salt.utils import SaltInvocationError
def __virtual__():
'''
@ -144,10 +146,15 @@ def present(
if isinstance(value, list):
value = ','.join(value)
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']: