mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #18644 from rallytime/boto_asg_fix
If the asg does not exist in the region provided, don't return True.
This commit is contained in:
commit
0bed869f1f
@ -78,8 +78,13 @@ def exists(name, region=None, key=None, keyid=None, profile=None):
|
||||
if not conn:
|
||||
return False
|
||||
try:
|
||||
conn.get_all_groups(names=[name])
|
||||
return True
|
||||
_conn = conn.get_all_groups(names=[name])
|
||||
if _conn:
|
||||
return True
|
||||
else:
|
||||
msg = 'The autoscale group does not exist in region {0}'.format(region)
|
||||
log.debug(msg)
|
||||
return False
|
||||
except boto.exception.BotoServerError as e:
|
||||
log.debug(e)
|
||||
return False
|
||||
@ -385,10 +390,16 @@ def launch_configuration_exists(name, region=None, key=None, keyid=None,
|
||||
conn = _get_conn(region, key, keyid, profile)
|
||||
if not conn:
|
||||
return False
|
||||
lc = conn.get_all_launch_configurations(names=[name])
|
||||
if lc:
|
||||
return True
|
||||
else:
|
||||
try:
|
||||
lc = conn.get_all_launch_configurations(names=[name])
|
||||
if lc:
|
||||
return True
|
||||
else:
|
||||
msg = 'The launch configuration does not exist in region {0}'.format(region)
|
||||
log.debug(msg)
|
||||
return False
|
||||
except boto.exception.BotoServerError as e:
|
||||
log.debug(e)
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user