From a21ab1a94f94e0268eda85b13a2a68fb526050f7 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 --- cloud/ec2_elb | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/cloud/ec2_elb b/cloud/ec2_elb index 4fc6910691b..21d771221b5 100644 --- a/cloud/ec2_elb +++ b/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'},