mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fix Base64 decode TypeError (#36968)
``` TypeError: expected bytes-like object, not str ```
This commit is contained in:
parent
b973fff276
commit
83aaa8137a
1 changed files with 1 additions and 1 deletions
|
@ -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]))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue