From: Feng Hualong Date: Fri, 27 Mar 2020 09:48:05 +0000 (+0800) Subject: orchestra: add ed25519key keytype to connection X-Git-Tag: 1.1.0~140^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=71447d427e7d5754d3ee869148ec5735aef13c88;p=teuthology.git orchestra: add ed25519key keytype to connection Signed-off-by: Feng Hualong --- diff --git a/teuthology/orchestra/connection.py b/teuthology/orchestra/connection.py index 44e939be9..20a3b8fb2 100644 --- a/teuthology/orchestra/connection.py +++ b/teuthology/orchestra/connection.py @@ -27,14 +27,16 @@ def split_user(user_at_host): def create_key(keytype, key): """ - Create an ssh-rsa or ssh-dss key. + Create an ssh-rsa, ssh-dss or ssh-ed25519 key. """ if keytype == 'ssh-rsa': return paramiko.rsakey.RSAKey(data=base64.decodestring(key.encode())) elif keytype == 'ssh-dss': return paramiko.dsskey.DSSKey(data=base64.decodestring(key.encode())) + elif keytype == 'ssh-ed25519': + return paramiko.ed25519key.Ed25519Key(data=base64.decodestring(key.encode())) else: - raise ValueError('keytype must be ssh-rsa or ssh-dss (DSA)') + raise ValueError('keytype must be ssh-rsa, ssh-dss (DSA) or ssh-ed25519') def connect(user_at_host, host_key=None, keep_alive=False, timeout=60,