Skip to content

Commit

Permalink
AWSRetry ec2_eip
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Oct 16, 2021
1 parent 7c9db54 commit 7a5fa4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/ec2_eip.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def associate_ip_and_device(ec2, module, address, private_ip_address, device_id,
params['AllocationId'] = address['AllocationId']
else:
params['PublicIp'] = address['PublicIp']
res = ec2.associate_address(**params)
res = ec2.associate_address(aws_retry=True, **params)
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
msg = "Couldn't associate Elastic IP address with instance '{0}'".format(device_id)
module.fail_json_aws(e, msg=msg)
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/ec2_eip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,17 @@
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
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 boto3_tag_list_to_ansible_dict


def get_eips_details(module):
connection = module.client('ec2')
connection = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff())
filters = module.params.get("filters")
try:
response = connection.describe_addresses(
aws_retry=True,
Filters=ansible_dict_to_boto3_filter_list(filters)
)
except (BotoCoreError, ClientError) as e:
Expand Down

0 comments on commit 7a5fa4f

Please sign in to comment.