Fix bug with update_attached_elbs (#1266)

* fixed bug where we were using elb_backend.describe_load_balancers
incorrectly, returning all available load balancers when we wanted none.

* improve skip, clean up tests
This commit is contained in:
John Kerkstra 2017-10-17 00:04:47 -05:00 committed by Jack Danger
commit b8bb6c2dcf
2 changed files with 47 additions and 6 deletions

View file

@ -504,6 +504,10 @@ class AutoScalingBackend(BaseBackend):
group_instance_ids = set(
state.instance.id for state in group.instance_states)
# skip this if group.load_balancers is empty
# otherwise elb_backend.describe_load_balancers returns all available load balancers
if not group.load_balancers:
return
try:
elbs = self.elb_backend.describe_load_balancers(
names=group.load_balancers)