mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ec2_group_facts tag list should have case preserved (#24760)
Tags should retain case, and should not be snake cased. Easiest way to do this is to snake before converting tag list as while that affects the keys of the boto3 tag lists, it doesn't affect the values. Need to use `tag_value_key_name` and `tag_name_key_name` following recent change to `boto3_tag_list_to_ansible_dict`, which used to handle both `key`/`Key` and `value`/`Value`
This commit is contained in:
parent
feafae70b5
commit
5741712a09
1 changed files with 5 additions and 3 deletions
|
@ -153,11 +153,13 @@ def main():
|
|||
except ClientError as e:
|
||||
module.fail_json(msg=e.message, exception=traceback.format_exc())
|
||||
|
||||
# Modify boto3 tags list to be ansible friendly dict and then camel_case
|
||||
snaked_security_groups = []
|
||||
for security_group in security_groups['SecurityGroups']:
|
||||
security_group['Tags'] = boto3_tag_list_to_ansible_dict(security_group['Tags'])
|
||||
snaked_security_groups.append(camel_dict_to_snake_dict(security_group))
|
||||
# Modify boto3 tags list to be ansible friendly dict
|
||||
# but don't camel case tags
|
||||
security_group = camel_dict_to_snake_dict(security_group)
|
||||
security_group['tags'] = boto3_tag_list_to_ansible_dict(security_group['tags'], tag_name_key_name='key', tag_value_key_name='value')
|
||||
snaked_security_groups.append(security_group)
|
||||
|
||||
module.exit_json(security_groups=snaked_security_groups)
|
||||
|
||||
|
|
Loading…
Reference in a new issue