From 30094912ebc89ec3c13851437f44c09a402aec3b Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 1 Dec 2015 07:03:57 -0800 Subject: [PATCH] boto is expecting that we pass it unicode strings. The secret_key parameter especially can contain non-ascii characters and will throw an error if such a string is passed as a byte str. Potential fix for #13303 --- lib/ansible/module_utils/ec2.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/module_utils/ec2.py b/lib/ansible/module_utils/ec2.py index a7f8c78127..74c215539f 100644 --- a/lib/ansible/module_utils/ec2.py +++ b/lib/ansible/module_utils/ec2.py @@ -177,6 +177,10 @@ def get_aws_connection_info(module, boto3=False): if validate_certs and HAS_LOOSE_VERSION and LooseVersion(boto.Version) >= LooseVersion("2.6.0"): 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') + return region, ec2_url, boto_params