mirror of https://github.com/jumpserver/jumpserver
添加解密时异常处理
parent
c71e685913
commit
731196094b
14
connect.py
14
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
|
Loading…
Reference in New Issue