Commit 67bf0750 authored by ibuler's avatar ibuler

[Update] 修改选择gateway

parent 6dfb4cb0
...@@ -215,8 +215,9 @@ class SSHConnection: ...@@ -215,8 +215,9 @@ class SSHConnection:
) )
if not domain.has_ssh_gateway(): if not domain.has_ssh_gateway():
return None return None
for i in domain.gateways: for gateway in domain.gateways:
gateway = domain.random_ssh_gateway() if gateway.protocol != "ssh":
continue
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment