fix: 修改网关测试可连接性报错提示信息

pull/6884/head
Michael Bai 2021-09-16 10:59:01 +08:00 committed by Jiangjie.Bai
parent 2030cbd19d
commit 7890e43f5a
3 changed files with 13 additions and 6 deletions

View File

@ -144,10 +144,17 @@ class Gateway(BaseUser):
key_filename=self.private_key_file,
sock=sock,
timeout=5)
except (paramiko.SSHException, paramiko.ssh_exception.SSHException,
paramiko.AuthenticationException, TimeoutError) as e:
except (paramiko.SSHException,
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
return False, str(e)
return False, err
finally:
client.close()
self.is_connective = True

Binary file not shown.

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: JumpServer 0.3.3\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"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: JumpServer team<ibuler@qq.com>\n"
@ -687,7 +687,7 @@ msgstr "无法连接到 {ip} 上的端口 {port}"
msgid "Authentication failed"
msgstr "认证失败"
#: assets/models/domain.py:133
#: assets/models/domain.py:133 assets/models/domain.py:155
msgid "Connect failed"
msgstr "连接失败"
@ -1433,7 +1433,7 @@ msgstr "{ApplicationPermission} 添加 {SystemUser}"
msgid "{ApplicationPermission} REMOVE {SystemUser}"
msgstr "{ApplicationPermission} 移除 {SystemUser}"
#: authentication/api/connection_token.py:226
#: authentication/api/connection_token.py:230
msgid "Invalid token"
msgstr "无效的令牌"