From 956fe7362dfedb05808f6675b5457cbb18336895 Mon Sep 17 00:00:00 2001 From: Ryan Brown Date: Tue, 19 Jun 2018 14:46:24 -0400 Subject: [PATCH] [aws] Fix unused return value in ec2_vpc_vgw_facts module (#41697) --- lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py index d5d54f0128..5373101dce 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py @@ -124,10 +124,8 @@ def list_virtual_gateways(client, module): except botocore.exceptions.ClientError as e: module.fail_json(msg=str(e), exception=traceback.format_exc()) - snaked_vgws = [camel_dict_to_snake_dict(get_virtual_gateway_info(vgw)) - for vgw in all_virtual_gateways['VpnGateways']] - - module.exit_json(virtual_gateways=snaked_vgws) + return [camel_dict_to_snake_dict(get_virtual_gateway_info(vgw)) + for vgw in all_virtual_gateways['VpnGateways']] def main(): @@ -154,7 +152,7 @@ def main(): # call your function here results = list_virtual_gateways(connection, module) - module.exit_json(result=results) + module.exit_json(virtual_gateways=results) if __name__ == '__main__':