From 83aaa8137ac96743aef3ea0528363d6861528d48 Mon Sep 17 00:00:00 2001 From: Patrick Marques Date: Sat, 3 Mar 2018 21:33:07 +0000 Subject: [PATCH] Fix Base64 decode TypeError (#36968) ``` TypeError: expected bytes-like object, not str ``` --- lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py b/lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py index 59a6c3ccda..20d01c3ec7 100644 --- a/lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py +++ b/lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py @@ -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]))