1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge branch 'elb' of https://github.com/bpennypacker/ansible into bpennypacker-elb

This commit is contained in:
James Cammarata 2014-04-28 20:39:10 -05:00
commit 826198196b

View file

@ -128,19 +128,21 @@ class ElbManager:
to report it out-of-service""" to report it out-of-service"""
for lb in self.lbs: for lb in self.lbs:
initial_state = self._get_instance_health(lb) if wait else None initial_state = self._get_instance_health(lb)
if initial_state is None:
if initial_state and initial_state.state == 'InService': # The instance isn't registered with this ELB so just
lb.deregister_instances([self.instance_id]) # return unchanged
else:
return return
lb.deregister_instances([self.instance_id])
# The ELB is changing state in some way. Either an instance that's
# InService is moving to OutOfService, or an instance that's
# already OutOfService is being deregistered.
self.changed = True
if wait: if wait:
self._await_elb_instance_state(lb, 'OutOfService', initial_state, timeout) self._await_elb_instance_state(lb, 'OutOfService', initial_state, timeout)
else:
# We cannot assume no change was made if we don't wait
# to find out
self.changed = True
def register(self, wait, enable_availability_zone, timeout): def register(self, wait, enable_availability_zone, timeout):
"""Register the instance for all ELBs and wait for the ELB """Register the instance for all ELBs and wait for the ELB