Skip to content

Commit

Permalink
Fix Base64 decode TypeError (ansible#36968)
Browse files Browse the repository at this point in the history
```
TypeError: expected bytes-like object, not str
```
  • Loading branch information
pmarques authored and Will Thames committed Mar 5, 2018
1 parent 3f2d64a commit 2715d1d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]))


Expand Down

0 comments on commit 2715d1d

Please sign in to comment.