From 9817ec84a02ed10db5bc4d4eeae6515a54534eae Mon Sep 17 00:00:00 2001 From: mzizzi Date: Thu, 27 Jul 2017 16:15:05 -0400 Subject: [PATCH] [cloud] cast tag values to strings in ansible_dict_to_boto3_tag_list utility (#27396) * ansible_dict_to_boto3_tag_list cast tag values to string * ansible_dict_to_boto3_tag_list cast with to_native --- lib/ansible/module_utils/ec2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 74b61ee007a..4186128579f 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -30,6 +30,7 @@ import os import re from time import sleep +from ansible.module_utils._text import to_native from ansible.module_utils.cloud import CloudRetry try: @@ -495,7 +496,7 @@ def ansible_dict_to_boto3_tag_list(tags_dict, tag_name_key_name='Key', tag_value tags_list = [] for k, v in tags_dict.items(): - tags_list.append({tag_name_key_name: k, tag_value_key_name: v}) + tags_list.append({tag_name_key_name: k, tag_value_key_name: to_native(v)}) return tags_list