mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix tags in ec2_instance_facts (#30333)
* Fix tags in ec2_instance_facts The method boto3_tag_list_to_ansible_dict in module_utils/ec2.py changed and does no longer check whether the returned result of boto3 uses "key" or "Key" as the tag key identifier. This fixes ec2_instance_facts to make this check in its own, since boto3 may return "key" instead of "Key" * Since the indices for the tags are already formatted to lowercase by the snaking, we can assume, that the index for the tags are already formatted
This commit is contained in:
parent
9da5f542cc
commit
f3865e370c
1 changed files with 1 additions and 2 deletions
|
@ -500,8 +500,7 @@ def list_ec2_instances(connection, module):
|
||||||
|
|
||||||
# Turn the boto3 result in to ansible friendly tag dictionary
|
# Turn the boto3 result in to ansible friendly tag dictionary
|
||||||
for instance in snaked_instances:
|
for instance in snaked_instances:
|
||||||
if 'tags' in instance:
|
instance['tags'] = boto3_tag_list_to_ansible_dict(instance.get('tags', []), 'key', 'value')
|
||||||
instance['tags'] = boto3_tag_list_to_ansible_dict(instance['tags'])
|
|
||||||
|
|
||||||
module.exit_json(instances=snaked_instances)
|
module.exit_json(instances=snaked_instances)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue