Skip to content

Commit

Permalink
move describe_addresses call back to non-paginated (pagination not su…
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble authored and alinabuzachis committed Aug 13, 2021
1 parent 1bcaaf8 commit 4088aaf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions plugins/modules/ec2_vpc_nat_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,6 @@
DRY_RUN_MSGS = 'DryRun Mode:'


@AWSRetry.jittered_backoff(retries=10)
def _describe_addresses(client, **params):
paginator = client.get_paginator('describe_addresses')
return paginator.paginate(**params).build_full_result()['Addresses']


@AWSRetry.jittered_backoff(retries=10)
def _describe_nat_gateways(client, **params):
paginator = client.get_paginator('describe_nat_gateways')
Expand Down Expand Up @@ -546,7 +540,7 @@ def get_eip_allocation_id_by_address(client, eip_address, check_mode=False):
err_msg = ""
try:
if not check_mode:
allocations = _describe_addresses(client, **params)
allocations = client.describe_addresses(aws_retry=True, **params)
if len(allocations) == 1:
allocation = allocations[0]
else:
Expand Down Expand Up @@ -644,7 +638,7 @@ def release_address(client, allocation_id, check_mode=False):

ip_released = False
try:
_describe_addresses(client, aws_retry=True, AllocationIds=[allocation_id])
client.describe_addresses(aws_retry=True, AllocationIds=[allocation_id])
except botocore.exceptions.ClientError as e:
# IP address likely already released
# Happens with gateway in 'deleted' state that
Expand Down

0 comments on commit 4088aaf

Please sign in to comment.