mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
[cloud][python3] bytes fix to make ec2_key work on python 3 (#23051)
This commit is contained in:
committed by
Ryan Brown
parent
ea7bff4a3f
commit
7720ef8ec1
@@ -117,6 +117,7 @@ try:
|
||||
except ImportError:
|
||||
HAS_BOTO = False
|
||||
|
||||
from ansible.module_utils._text import to_bytes
|
||||
import random
|
||||
import string
|
||||
|
||||
@@ -226,7 +227,7 @@ def main():
|
||||
if not module.check_mode:
|
||||
if key_material:
|
||||
'''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:
|
||||
'''
|
||||
No material provided, let AWS handle the key creation and
|
||||
|
||||
Reference in New Issue
Block a user