Merge pull request #6318 from jimi-c/issue_5305_ec2_elb_None_issue
Adding a wait loop to ec2_elb for the initial lb state when registering
This commit is contained in:
commit
4dea5a8672
1 changed files with 11 additions and 1 deletions
|
@ -157,7 +157,17 @@ class ElbManager:
|
||||||
to report the instance in-service"""
|
to report the instance in-service"""
|
||||||
for lb in self.lbs:
|
for lb in self.lbs:
|
||||||
if wait:
|
if wait:
|
||||||
|
tries = 1
|
||||||
|
while True:
|
||||||
initial_state = self._get_instance_health(lb)
|
initial_state = self._get_instance_health(lb)
|
||||||
|
if initial_state:
|
||||||
|
break
|
||||||
|
time.sleep(1)
|
||||||
|
tries += 1
|
||||||
|
# FIXME: this should be configurable, but since it didn't
|
||||||
|
# wait at all before this is at least better
|
||||||
|
if tries > 10:
|
||||||
|
self.module.fail_json(msg='failed to find the initial state of the load balancer')
|
||||||
|
|
||||||
if enable_availability_zone:
|
if enable_availability_zone:
|
||||||
self._enable_availailability_zone(lb)
|
self._enable_availailability_zone(lb)
|
||||||
|
|
Loading…
Reference in a new issue