Fix describing transit gateways with backoff in ec2_transit_gateway (#67247)
* Fix ec2_transit_gateway retries. AWSRetry must be used within ClientError handling to have any effect * changelog
This commit is contained in:
parent
3f5aed056b
commit
4719072c49
2 changed files with 3 additions and 2 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- ec2_transit_gateway - Use AWSRetry before ClientError is handled when describing transit gateways
|
|
@ -313,7 +313,6 @@ class AnsibleEc2Tgw(object):
|
||||||
|
|
||||||
return transit_gateway
|
return transit_gateway
|
||||||
|
|
||||||
@AWSRetry.exponential_backoff()
|
|
||||||
def get_matching_tgw(self, tgw_id, description=None, skip_deleted=True):
|
def get_matching_tgw(self, tgw_id, description=None, skip_deleted=True):
|
||||||
""" search for an existing tgw by either tgw_id or description
|
""" search for an existing tgw by either tgw_id or description
|
||||||
:param tgw_id: The AWS id of the transit gateway
|
:param tgw_id: The AWS id of the transit gateway
|
||||||
|
@ -326,7 +325,7 @@ class AnsibleEc2Tgw(object):
|
||||||
filters = ansible_dict_to_boto3_filter_list({'transit-gateway-id': tgw_id})
|
filters = ansible_dict_to_boto3_filter_list({'transit-gateway-id': tgw_id})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = self._connection.describe_transit_gateways(Filters=filters)
|
response = AWSRetry.exponential_backoff()(self._connection.describe_transit_gateways)(Filters=filters)
|
||||||
except (ClientError, BotoCoreError) as e:
|
except (ClientError, BotoCoreError) as e:
|
||||||
self._module.fail_json_aws(e)
|
self._module.fail_json_aws(e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue