mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
If the elb does not exist in the region provided, don't return True
This commit is contained in:
parent
9e2de0fa2a
commit
70b44b68db
1 changed files with 7 additions and 2 deletions
|
@ -77,8 +77,13 @@ def exists(name, region=None, key=None, keyid=None, profile=None):
|
|||
if not conn:
|
||||
return False
|
||||
try:
|
||||
conn.get_all_load_balancers(load_balancer_names=[name])
|
||||
return True
|
||||
elb = conn.get_all_load_balancers(load_balancer_names=[name])
|
||||
if elb:
|
||||
return True
|
||||
else:
|
||||
msg = 'The load balancer 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…
Add table
Reference in a new issue