Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a wait loop to ec2_elb for the initial lb state when registering #6318

Merged
merged 1 commit into from Mar 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion library/cloud/ec2_elb
Expand Up @@ -157,7 +157,17 @@ class ElbManager:
to report the instance in-service"""
for lb in self.lbs:
if wait:
initial_state = self._get_instance_health(lb)
tries = 1
while True:
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:
self._enable_availailability_zone(lb)
Expand Down