Skip to content

Commit

Permalink
ec2_transit_gateway_IncorrectState: retry on IncorrectState (ansible-…
Browse files Browse the repository at this point in the history
…collections#1110)

* ec2_transit_gateway_IncorrectState: retry on IncorrectState

Do not immediately bail out in case of IncorrectState error. We now
instead wait and retry.

E.g: https://ddf1d621d7b816539203-e56a3e9170eb32404c2ff3e77b13356f.ssl.cf2.rackcdn.com/799/690df9c2d3f69323837542b96fa7318650fd5308/check/integration-community.aws-1/f30fb4f/job-output.txt

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@de08a9d
  • Loading branch information
goneri authored and mandar242 committed Oct 23, 2024
1 parent 1890c43 commit 2cba062
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/modules/ec2_transit_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ class AnsibleEc2Tgw(object):
def __init__(self, module, results):
self._module = module
self._results = results
self._connection = self._module.client('ec2')
retry_decorator = AWSRetry.jittered_backoff(
catch_extra_error_codes=['IncorrectState'],
)
connection = module.client('ec2', retry_decorator=retry_decorator)
self._connection = connection
self._check_mode = self._module.check_mode

def process(self):
Expand Down

0 comments on commit 2cba062

Please sign in to comment.