From 4e257fad842ec8556ce53268e644fec4607e194c Mon Sep 17 00:00:00 2001 From: Eugene Krokhalev Date: Tue, 31 Jan 2017 19:17:04 +0400 Subject: [PATCH] [cloud] `unicode` is absent on Python 3, use text_type (#20861) --- lib/ansible/module_utils/ec2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index 8db34bfba5f..8891fb85167 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -52,7 +52,7 @@ try: except: HAS_LOOSE_VERSION = False -from ansible.module_utils.six import string_types +from ansible.module_utils.six import string_types, binary_type, text_type class AnsibleAWSError(Exception): pass @@ -232,8 +232,8 @@ def get_aws_connection_info(module, boto3=False): boto_params['validate_certs'] = validate_certs for param, value in boto_params.items(): - if isinstance(value, str): - boto_params[param] = unicode(value, 'utf-8', 'strict') + if isinstance(value, binary_type): + boto_params[param] = text_type(value, 'utf-8', 'strict') return region, ec2_url, boto_params