From 524c5dcfefb06f2cd931b8028fee7d101e9983d1 Mon Sep 17 00:00:00 2001 From: Abhijit Menon-Sen Date: Thu, 14 Sep 2017 17:00:09 +0530 Subject: [PATCH] Avoid KeyError when subnet['Tags'] doesn't exist (#30349) The problem was introduced in 2cdf31d3. --- lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py index 828241e1111..a84ad4df606 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py @@ -215,7 +215,7 @@ def describe_subnets(connection, module): subnet['id'] = subnet['SubnetId'] subnet_info.append(camel_dict_to_snake_dict(subnet)) # convert tag list to ansible dict - subnet_info[-1]['tags'] = boto3_tag_list_to_ansible_dict(subnet['Tags']) + subnet_info[-1]['tags'] = boto3_tag_list_to_ansible_dict(subnet.get('Tags', [])) module.exit_json(subnets=subnet_info)