fix id_dsa check error

pull/458/head
倪建强 2017-05-26 09:47:52 +08:00
parent dd6c82b168
commit b36b702705
1 changed files with 3 additions and 4 deletions

View File

@ -180,15 +180,14 @@ def timesince(dt, since='', default="just now"):
def ssh_key_string_to_obj(text):
key_f = StringIO(text)
key = None
try:
key = paramiko.RSAKey.from_private_key(key_f)
key = paramiko.RSAKey.from_private_key( StringIO(text) )
except paramiko.SSHException:
pass
try:
key = paramiko.DSSKey.from_private_key(key_f)
key = paramiko.DSSKey.from_private_key( StringIO(text) )
except paramiko.SSHException:
pass
return key
@ -375,4 +374,4 @@ def sum_capacity(cap_list):
return capacity_convert(total, expect='auto')
signer = Signer()
signer = Signer()