unicode is absent in case of python3 - fix it (#20861)

pull/4420/head
Eugene Krokhalev 2017-01-31 19:17:04 +04:00 committed by Ryan Brown
parent 7e6758873c
commit eb7495efaf
1 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ try:
except: except:
HAS_LOOSE_VERSION = False 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): class AnsibleAWSError(Exception):
pass pass
@ -232,8 +232,8 @@ def get_aws_connection_info(module, boto3=False):
boto_params['validate_certs'] = validate_certs boto_params['validate_certs'] = validate_certs
for param, value in boto_params.items(): for param, value in boto_params.items():
if isinstance(value, str): if isinstance(value, binary_type):
boto_params[param] = unicode(value, 'utf-8', 'strict') boto_params[param] = text_type(value, 'utf-8', 'strict')
return region, ec2_url, boto_params return region, ec2_url, boto_params