Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

1 participant

@jimi-c
Owner

Fixes #5305

@jimi-c jimi-c merged commit 5a235f9 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 1 deletion.
  1. +11 −1 library/cloud/ec2_elb
View
12 library/cloud/ec2_elb
@@ -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)
Something went wrong with that request. Please try again.