mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Avoid KeyError when subnet['Tags'] doesn't exist (#30349)
The problem was introduced in 2cdf31d3
.
This commit is contained in:
parent
4c9ad00c50
commit
524c5dcfef
1 changed files with 1 additions and 1 deletions
|
@ -215,7 +215,7 @@ def describe_subnets(connection, module):
|
||||||
subnet['id'] = subnet['SubnetId']
|
subnet['id'] = subnet['SubnetId']
|
||||||
subnet_info.append(camel_dict_to_snake_dict(subnet))
|
subnet_info.append(camel_dict_to_snake_dict(subnet))
|
||||||
# convert tag list to ansible dict
|
# 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)
|
module.exit_json(subnets=subnet_info)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue