Skip to content

Commit

Permalink
Avoid KeyError when subnet['Tags'] doesn't exist (ansible#30349)
Browse files Browse the repository at this point in the history
The problem was introduced in 2cdf31d.
  • Loading branch information
amenonsen authored and willthames committed Sep 14, 2017
1 parent 4c9ad00 commit 524c5dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/modules/cloud/amazon/ec2_vpc_subnet_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 524c5dc

Please sign in to comment.