From 6e809c2be360b9684baf72f52861add1dd5c1a45 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sat, 29 Mar 2014 23:47:11 -0500 Subject: [PATCH] Removing wait loop around initial state check during registration Also fixed a bug in which the state parameter was marked as a 'bool' type, which was breaking execution of the module. Fixes #6543 --- library/cloud/ec2_elb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/library/cloud/ec2_elb b/library/cloud/ec2_elb index 4fc6910691..21d771221b 100644 --- a/library/cloud/ec2_elb +++ b/library/cloud/ec2_elb @@ -162,18 +162,7 @@ class ElbManager: """Register the instance for all ELBs and wait for the ELB to report the instance in-service""" for lb in self.lbs: - if wait: - 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') + initial_state = self._get_instance_health(lb) if enable_availability_zone: self._enable_availailability_zone(lb) @@ -313,7 +302,7 @@ class ElbManager: def main(): argument_spec = ec2_argument_spec() argument_spec.update(dict( - state={'required': True, 'type' : 'bool'}, + state={'required': True}, instance_id={'required': True}, ec2_elbs={'default': None, 'required': False, 'type':'list'}, enable_availability_zone={'default': True, 'required': False, 'type': 'bool'},