Skip to content

Commit

Permalink
Put back identityfile parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Shehzaman <[email protected]>
  • Loading branch information
shehzaman authored and ulyssessouza committed Aug 31, 2021
1 parent 96c1272 commit 8da03e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docker/transport/sshconn.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,18 @@ def _create_paramiko_client(self, base_url):
with open(ssh_config_file) as f:
conf.parse(f)
host_config = conf.lookup(base_url.hostname)
self.ssh_conf = host_config
if 'proxycommand' in host_config:
self.ssh_params["sock"] = paramiko.ProxyCommand(
self.ssh_conf['proxycommand']
)
if 'hostname' in host_config:
self.ssh_params['hostname'] = host_config['hostname']
if base_url.port is None and 'port' in host_config:
self.ssh_params['port'] = self.ssh_conf['port']
self.ssh_params['port'] = host_config['port']
if base_url.username is None and 'user' in host_config:
self.ssh_params['username'] = self.ssh_conf['user']
self.ssh_params['username'] = host_config['user']
if 'identityfile' in host_config:
self.ssh_params['key_filename'] = host_config['identityfile']

self.ssh_client.load_system_host_keys()
self.ssh_client.set_missing_host_key_policy(paramiko.WarningPolicy())
Expand Down

0 comments on commit 8da03e0

Please sign in to comment.