[cloud][python3] bytes fix to make ec2_key work on python 3 (#23051)

pull/20575/merge
Sloane Hertel 7 years ago committed by Ryan Brown
parent ea7bff4a3f
commit 7720ef8ec1

@ -117,6 +117,7 @@ try:
except ImportError: except ImportError:
HAS_BOTO = False HAS_BOTO = False
from ansible.module_utils._text import to_bytes
import random import random
import string import string
@ -226,7 +227,7 @@ def main():
if not module.check_mode: if not module.check_mode:
if key_material: if key_material:
'''We are providing the key, need to import''' '''We are providing the key, need to import'''
key = ec2.import_key_pair(name, key_material) key = ec2.import_key_pair(name, to_bytes(key_material))
else: else:
''' '''
No material provided, let AWS handle the key creation and No material provided, let AWS handle the key creation and

Loading…
Cancel
Save