From a7ef6b231c5775c77cfe1a6626ec5bd9931319ac Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Tue, 15 Oct 2024 14:18:42 -0700 Subject: [PATCH] minor fixes to match a.aws module_utils/ec2 --- plugins/modules/ec2_vpc_vgw.py | 4 ++-- plugins/modules/ec2_vpc_vgw_info.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/modules/ec2_vpc_vgw.py b/plugins/modules/ec2_vpc_vgw.py index a6b646a0777..fe15c87272d 100644 --- a/plugins/modules/ec2_vpc_vgw.py +++ b/plugins/modules/ec2_vpc_vgw.py @@ -298,7 +298,7 @@ def delete_vgw(client, module, vpn_gateway_id): if vpn_gateway_id: params["VpnGatewayId"] = vpn_gateway_id try: - response = delete_vpc_vpn_gateway(client, **params) + delete_vpc_vpn_gateway(client, **params) except AnsibleEC2Error as e: module.fail_json_aws(e) @@ -338,7 +338,7 @@ def find_vgw(client, module, vpn_gateway_id=None): except AnsibleEC2Error as e: module.fail_json_aws(e) - return sorted(response["VpnGateways"], key=lambda k: k["VpnGatewayId"]) + return sorted(response, key=lambda k: k["VpnGatewayId"]) def ensure_vgw_present(client, module): diff --git a/plugins/modules/ec2_vpc_vgw_info.py b/plugins/modules/ec2_vpc_vgw_info.py index bd40af0292d..f6d08332464 100644 --- a/plugins/modules/ec2_vpc_vgw_info.py +++ b/plugins/modules/ec2_vpc_vgw_info.py @@ -160,7 +160,7 @@ def list_virtual_gateways(client, module): return [ camel_dict_to_snake_dict(get_virtual_gateway_info(vgw), ignore_list=["ResourceTags"]) - for vgw in all_virtual_gateways["VpnGateways"] + for vgw in all_virtual_gateways ]