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
This commit is contained in:
parent
eef11f0bf1
commit
a21ab1a94f
1 changed files with 2 additions and 13 deletions
|
@ -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'},
|
||||
|
|
Loading…
Reference in a new issue