mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-07 19:23:09 +00:00
Fix Base64 decode TypeError (#36968)
``` TypeError: expected bytes-like object, not str ```
This commit is contained in:
@@ -239,7 +239,7 @@ def core(module):
|
||||
|
||||
def ssh_key_fingerprint(ssh_pub_key):
|
||||
key = ssh_pub_key.split(None, 2)[1]
|
||||
fingerprint = hashlib.md5(base64.decodestring(key)).hexdigest()
|
||||
fingerprint = hashlib.md5(base64.b64decode(key)).hexdigest()
|
||||
return ':'.join(a + b for a, b in zip(fingerprint[::2], fingerprint[1::2]))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user