From 731196094b7a5230f16de4f7544c2acad0d30af6 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sun, 28 Dec 2014 19:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=A3=E5=AF=86=E6=97=B6?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/connect.py b/connect.py index e604bcca9..e3396ff0c 100755 --- a/connect.py +++ b/connect.py @@ -204,9 +204,15 @@ def get_connect_item(username, ip): perm = perms[0] if perm.role == 'SU': - return asset.username_super, cryptor.decrypt(asset.password_super), ip, port + try: + return asset.username_super, cryptor.decrypt(asset.password_super), ip, port + except TypeError: + red_print('User %s password error to decrypt.' % username) else: - return asset.username_common, cryptor.decrypt(asset.password_common), ip, port + try: + return asset.username_common, cryptor.decrypt(asset.password_common), ip, port + except TypeError: + red_print('User %s password error to decrypt.' % username) def verify_connect(username, part_ip): @@ -305,6 +311,4 @@ if __name__ == '__main__': else: verify_connect(LOGIN_NAME, option) except IndexError: - pass - - + pass \ No newline at end of file