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 return ret
except boto.exception.BotoServerError as error: except boto.exception.BotoServerError as error:
log.debug(error) log.debug(error)
return [] return {}
def create(name, availability_zones, listeners=None, subnets=None, def create(name, availability_zones, listeners=None, subnets=None,

View File

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