mirror of https://github.com/jumpserver/jumpserver
添加解密时异常处理
parent
c71e685913
commit
731196094b
|
@ -204,9 +204,15 @@ def get_connect_item(username, ip):
|
||||||
perm = perms[0]
|
perm = perms[0]
|
||||||
|
|
||||||
if perm.role == 'SU':
|
if perm.role == 'SU':
|
||||||
|
try:
|
||||||
return asset.username_super, cryptor.decrypt(asset.password_super), ip, port
|
return asset.username_super, cryptor.decrypt(asset.password_super), ip, port
|
||||||
|
except TypeError:
|
||||||
|
red_print('User %s password error to decrypt.' % username)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
return asset.username_common, cryptor.decrypt(asset.password_common), ip, port
|
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):
|
def verify_connect(username, part_ip):
|
||||||
|
@ -306,5 +312,3 @@ if __name__ == '__main__':
|
||||||
verify_connect(LOGIN_NAME, option)
|
verify_connect(LOGIN_NAME, option)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue