Skip to content

Commit

Permalink
Respect wait parameter in elb_instance when adding/removing instances (
Browse files Browse the repository at this point in the history
…ansible-collections#826)

Respect wait parameter in elb_instance when adding/removing instances

SUMMARY
The wait parameter is currently ignored when registering or
deregistering an instance with an ELB. Looks like this was lost in the
boto3 migration: 96f1518
Related: ansible-collections#825
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
elb_instance
ADDITIONAL INFORMATION
See ansible-collections#825

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Markus Bergholz <[email protected]>
  • Loading branch information
hughsaunders authored and abikouo committed Sep 18, 2023
1 parent 8507c31 commit 97044d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions elb_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def deregister(self, wait, timeout):
# already OutOfService is being deregistered.
self.changed = True

for lb in self.lbs:
self._await_elb_instance_state(lb, 'Deregistered', timeout)
if wait:
for lb in self.lbs:
self._await_elb_instance_state(lb, 'Deregistered', timeout)

def register(self, wait, enable_availability_zone, timeout):
"""Register the instance for all ELBs and wait for the ELB
Expand Down Expand Up @@ -176,8 +177,9 @@ def register(self, wait, enable_availability_zone, timeout):

self.changed = True

for lb in self.lbs:
self._await_elb_instance_state(lb, 'InService', timeout)
if wait:
for lb in self.lbs:
self._await_elb_instance_state(lb, 'InService', timeout)

@AWSRetry.jittered_backoff()
def _describe_elbs(self, **params):
Expand Down

0 comments on commit 97044d4

Please sign in to comment.