From b01aa577fafe5efea6e4948eb4105458c61122a1 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 19 Feb 2021 00:55:39 +0100 Subject: [PATCH] Enable AWSRetry on aws_region_info (#422) * Enable AWSRetry on aws_region_info * changelog --- changelogs/fragments/422-aws_region_info-retry.yml | 2 ++ plugins/modules/aws_region_info.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/422-aws_region_info-retry.yml diff --git a/changelogs/fragments/422-aws_region_info-retry.yml b/changelogs/fragments/422-aws_region_info-retry.yml new file mode 100644 index 00000000000..03e6086b21e --- /dev/null +++ b/changelogs/fragments/422-aws_region_info-retry.yml @@ -0,0 +1,2 @@ +minor_changes: +- aws_region_info - Add retries on common AWS failures (https://github.com/ansible-collections/community.aws/pull/422). diff --git a/plugins/modules/aws_region_info.py b/plugins/modules/aws_region_info.py index d0b74e3f112..bedb8a5f1fa 100644 --- a/plugins/modules/aws_region_info.py +++ b/plugins/modules/aws_region_info.py @@ -58,7 +58,9 @@ ''' from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule -from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, ansible_dict_to_boto3_filter_list, camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict try: from botocore.exceptions import ClientError, BotoCoreError @@ -86,6 +88,7 @@ def main(): try: regions = connection.describe_regions( + aws_retry=True, Filters=ansible_dict_to_boto3_filter_list(sanitized_filters) ) except (BotoCoreError, ClientError) as e: