mirror of https://github.com/jumpserver/jumpserver
fix: 修改网关测试可连接性报错提示信息
parent
2030cbd19d
commit
7890e43f5a
|
@ -144,10 +144,17 @@ class Gateway(BaseUser):
|
||||||
key_filename=self.private_key_file,
|
key_filename=self.private_key_file,
|
||||||
sock=sock,
|
sock=sock,
|
||||||
timeout=5)
|
timeout=5)
|
||||||
except (paramiko.SSHException, paramiko.ssh_exception.SSHException,
|
except (paramiko.SSHException,
|
||||||
paramiko.AuthenticationException, TimeoutError) as e:
|
paramiko.ssh_exception.SSHException,
|
||||||
|
paramiko.ChannelException,
|
||||||
|
paramiko.AuthenticationException,
|
||||||
|
TimeoutError) as e:
|
||||||
|
|
||||||
|
err = getattr(e, 'text', str(e))
|
||||||
|
if err == 'Connect failed':
|
||||||
|
err = _('Connect failed')
|
||||||
self.is_connective = False
|
self.is_connective = False
|
||||||
return False, str(e)
|
return False, err
|
||||||
finally:
|
finally:
|
||||||
client.close()
|
client.close()
|
||||||
self.is_connective = True
|
self.is_connective = True
|
||||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: JumpServer 0.3.3\n"
|
"Project-Id-Version: JumpServer 0.3.3\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-09-16 10:31+0800\n"
|
"POT-Creation-Date: 2021-09-16 10:57+0800\n"
|
||||||
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
|
"PO-Revision-Date: 2021-05-20 10:54+0800\n"
|
||||||
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
"Last-Translator: ibuler <ibuler@qq.com>\n"
|
||||||
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
"Language-Team: JumpServer team<ibuler@qq.com>\n"
|
||||||
|
@ -687,7 +687,7 @@ msgstr "无法连接到 {ip} 上的端口 {port}"
|
||||||
msgid "Authentication failed"
|
msgid "Authentication failed"
|
||||||
msgstr "认证失败"
|
msgstr "认证失败"
|
||||||
|
|
||||||
#: assets/models/domain.py:133
|
#: assets/models/domain.py:133 assets/models/domain.py:155
|
||||||
msgid "Connect failed"
|
msgid "Connect failed"
|
||||||
msgstr "连接失败"
|
msgstr "连接失败"
|
||||||
|
|
||||||
|
@ -1433,7 +1433,7 @@ msgstr "{ApplicationPermission} 添加 {SystemUser}"
|
||||||
msgid "{ApplicationPermission} REMOVE {SystemUser}"
|
msgid "{ApplicationPermission} REMOVE {SystemUser}"
|
||||||
msgstr "{ApplicationPermission} 移除 {SystemUser}"
|
msgstr "{ApplicationPermission} 移除 {SystemUser}"
|
||||||
|
|
||||||
#: authentication/api/connection_token.py:226
|
#: authentication/api/connection_token.py:230
|
||||||
msgid "Invalid token"
|
msgid "Invalid token"
|
||||||
msgstr "无效的令牌"
|
msgstr "无效的令牌"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue