From 0943179d35403446b5896b88f79dc761346048d1 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Fri, 13 Dec 2019 01:54:37 +0100 Subject: [PATCH] orchestra/connection: cast 'key' to bytes for base64.decodestring Because base64.decodestring accepts bytes, the key variable should be converted from string obj. Signed-off-by: Kyr Shatskyy --- teuthology/orchestra/connection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/orchestra/connection.py b/teuthology/orchestra/connection.py index 81f78bbd1..44e939be9 100644 --- a/teuthology/orchestra/connection.py +++ b/teuthology/orchestra/connection.py @@ -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)') -- 2.47.3