mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Python 3 fixes for CloudStack modules and tests. (#24400)
This commit is contained in:
parent
6aa32d3e9d
commit
d999d613cb
23 changed files with 25 additions and 29 deletions
|
@ -120,6 +120,7 @@ except ImportError:
|
|||
HAS_LIB_SSHPUBKEYS = False
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.module_utils.cloudstack import (
|
||||
AnsibleCloudStack,
|
||||
CloudStackException,
|
||||
|
@ -232,6 +233,8 @@ class AnsibleCloudStackSshKey(AnsibleCloudStack):
|
|||
|
||||
def _get_ssh_fingerprint(self, public_key):
|
||||
key = sshpubkeys.SSHKey(public_key)
|
||||
if hasattr(key, 'hash_md5'):
|
||||
return key.hash_md5().replace(to_native('MD5:'), to_native(''))
|
||||
return key.hash()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue