Unverified Commit 59ef8545 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #43 from jumpserver/dev

Dev
parents 98e8df01 f6be91a2
...@@ -87,12 +87,14 @@ class ProxyServer: ...@@ -87,12 +87,14 @@ class ProxyServer:
pass pass
def get_proxy_sock(self, asset): def get_proxy_sock(self, asset):
sock = None
domain = self.app.service.get_domain_detail_with_gateway( domain = self.app.service.get_domain_detail_with_gateway(
asset.domain asset.domain
) )
sock = None if not domain.has_ssh_gateway():
return None
for i in domain.gateways: for i in domain.gateways:
gateway = domain.random_gateway() gateway = domain.random_ssh_gateway()
proxy_command = [ proxy_command = [
"ssh", "-p", str(gateway.port), "ssh", "-p", str(gateway.port),
"{}@{}".format(gateway.username, gateway.ip), "{}@{}".format(gateway.username, gateway.ip),
......
...@@ -20,7 +20,7 @@ Jinja2==2.10 ...@@ -20,7 +20,7 @@ Jinja2==2.10
jmespath==0.9.3 jmespath==0.9.3
jms-es-sdk==0.5.2 jms-es-sdk==0.5.2
jms-storage==0.0.12 jms-storage==0.0.12
jumpserver-python-sdk==0.0.34 jumpserver-python-sdk==0.0.35
MarkupSafe==1.0 MarkupSafe==1.0
oss2==2.4.0 oss2==2.4.0
paramiko==2.4.0 paramiko==2.4.0
......
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