Merge pull request #30644 from tbaker57/another_go_at_30573

Another go at fixing 30573
This commit is contained in:
Nicole Thomas 2016-01-26 13:18:41 -07:00
commit 30e03a8b0c
2 changed files with 22 additions and 21 deletions

View File

@ -147,7 +147,7 @@ def get_elb_config(name, region=None, key=None, keyid=None, profile=None):
return ret
except boto.exception.BotoServerError as error:
log.debug(error)
return []
return {}
def create(name, availability_zones, listeners=None, subnets=None,

View File

@ -334,26 +334,27 @@ def present(
lb = __salt__['boto_elb.get_elb_config'](
name, region, key, keyid, profile
)
for cname in cnames:
_ret = __states__['boto_route53.present'](
name=cname.get('name'),
value=lb['dns_name'],
zone=cname.get('zone'),
record_type='CNAME',
identifier=cname.get('identifier', None),
ttl=cname.get('ttl', None),
region=region,
key=key,
keyid=keyid,
profile=profile,
wait_for_sync=wait_for_sync
)
ret['changes'] = dictupdate.update(ret['changes'], _ret['changes'])
ret['comment'] = ' '.join([ret['comment'], _ret['comment']])
if not _ret['result']:
ret['result'] = _ret['result']
if ret['result'] is False:
return ret
if len(lb) > 0:
for cname in cnames:
_ret = __states__['boto_route53.present'](
name=cname.get('name'),
value=lb['dns_name'],
zone=cname.get('zone'),
record_type='CNAME',
identifier=cname.get('identifier', None),
ttl=cname.get('ttl', None),
region=region,
key=key,
keyid=keyid,
profile=profile,
wait_for_sync=wait_for_sync
)
ret['changes'] = dictupdate.update(ret['changes'], _ret['changes'])
ret['comment'] = ' '.join([ret['comment'], _ret['comment']])
if not _ret['result']:
ret['result'] = _ret['result']
if ret['result'] is False:
return ret
_ret = _alarms_present(name, alarms, alarms_from_pillar, region, key, keyid, profile)
ret['changes'] = dictupdate.update(ret['changes'], _ret['changes'])
ret['comment'] = ' '.join([ret['comment'], _ret['comment']])