Skip to content

Commit

Permalink
* Address reviewer's comments
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Mar 16, 2021
1 parent 05988db commit d857003
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_nat_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@


@AWSRetry.jittered_backoff(retries=10)
def _describe_nat_gateways(client, **params):
def _describe_nat_gateways(client, module, **params):
try:
paginator = client.get_paginator('describe_nat_gateways')
return paginator.paginate(**params).build_full_result()['NatGateways']
except is_boto3_error_code('InvalidNatGatewayID.NotFound'):
return list()
except is_boto3_error_code('NatGatewayMalformed'): # pylint: disable=duplicate-except
return list()
module.exit_json(msg="NAT gateway id is malformed.")


def get_nat_gateways(client, module):
Expand All @@ -178,7 +178,7 @@ def get_nat_gateways(client, module):
params['NatGatewayIds'] = module.params.get('nat_gateway_ids')

try:
result = normalize_boto3_result(_describe_nat_gateways(client, **params))
result = normalize_boto3_result(_describe_nat_gateways(client, module, **params))
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
module.fail_json_aws(e, 'Unable to describe NAT gateways.')

Expand All @@ -196,7 +196,7 @@ def get_nat_gateways(client, module):
def main():
argument_spec = dict(
filters=dict(default={}, type='dict'),
nat_gateway_ids=dict(default=[], type='list', elements='str')
nat_gateway_ids=dict(default=[], type='list', elements='str'),
)

module = AnsibleAWSModule(argument_spec=argument_spec,
Expand Down

0 comments on commit d857003

Please sign in to comment.