From 65da6a07896f24948e5fd8c0c0413e8d158ff5ee Mon Sep 17 00:00:00 2001 From: Ted Timmons Date: Tue, 18 Jul 2017 21:35:31 +0200 Subject: [PATCH] [cloud][py3] Use to_bytes in ec2_key module in two more places (#26936) PR #23051 fixes the first failure of this, but it doesn't fix the successive calls. --- lib/ansible/modules/cloud/amazon/ec2_key.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_key.py b/lib/ansible/modules/cloud/amazon/ec2_key.py index 221ce24df42..062bddcd25d 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_key.py +++ b/lib/ansible/modules/cloud/amazon/ec2_key.py @@ -196,7 +196,7 @@ def main(): test = ec2.get_key_pair(tmpkeyname) # create tmp key - tmpkey = ec2.import_key_pair(tmpkeyname, key_material) + tmpkey = ec2.import_key_pair(tmpkeyname, to_bytes(key_material)) # get tmp key fingerprint tmpfingerprint = tmpkey.fingerprint # delete tmp key @@ -205,7 +205,7 @@ def main(): if key.fingerprint != tmpfingerprint: if not module.check_mode: key.delete() - key = ec2.import_key_pair(name, key_material) + key = ec2.import_key_pair(name, to_bytes(key_material)) if wait: start = time.time()