orchestra: add ed25519key keytype to connection
@@ -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,
