Skip to content

Commit

Permalink
Enable AWSRetry on aws_region_info (ansible-collections#422)
Browse files Browse the repository at this point in the history
* Enable AWSRetry on aws_region_info

* changelog
  • Loading branch information
tremble authored Feb 18, 2021
1 parent f2d4851 commit ea740a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/422-aws_region_info-retry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- aws_region_info - Add retries on common AWS failures (https://github.com/ansible-collections/community.aws/pull/422).
5 changes: 4 additions & 1 deletion plugins/modules/aws_region_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ea740a2

Please sign in to comment.