]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/connection: cast 'key' to bytes for base64.decodestring
authorKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Fri, 13 Dec 2019 00:54:37 +0000 (01:54 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Fri, 13 Dec 2019 16:49:38 +0000 (17:49 +0100)
Because base64.decodestring accepts bytes, the key variable
should be converted from string obj.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/orchestra/connection.py

index 81f78bbd1654022d57e8a37a7f034d75afd11457..44e939be9e4a3910d96be410a9aeb38713389c02 100644 (file)
@@ -30,9 +30,9 @@ def create_key(keytype, key):
     Create an ssh-rsa or ssh-dss key.
     """
     if keytype == 'ssh-rsa':
-        return paramiko.rsakey.RSAKey(data=base64.decodestring(key))
+        return paramiko.rsakey.RSAKey(data=base64.decodestring(key.encode()))
     elif keytype == 'ssh-dss':
-        return paramiko.dsskey.DSSKey(data=base64.decodestring(key))
+        return paramiko.dsskey.DSSKey(data=base64.decodestring(key.encode()))
     else:
         raise ValueError('keytype must be ssh-rsa or ssh-dss (DSA)')