From b36b702705634160a682b1b3086c5cfcd2684066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=80=AA=E5=BB=BA=E5=BC=BA?= Date: Fri, 26 May 2017 09:47:52 +0800 Subject: [PATCH] fix id_dsa check error --- apps/common/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/common/utils.py b/apps/common/utils.py index 2a70fab09..214fc72be 100644 --- a/apps/common/utils.py +++ b/apps/common/utils.py @@ -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() \ No newline at end of file +signer = Signer()