diff options
author | Anca Iordache <aiordache@users.noreply.github.com> | 2021-08-31 14:42:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 14:42:26 +0200 |
commit | 62af2bbb13cfa413ab3d9e3536c6996474fa4629 (patch) | |
tree | 0423df6fd37d5cd3cbddc16dfc0a6154d0e28575 /docker/transport | |
parent | 5705d12813798dc84fb304c1dc55422b0432c8b2 (diff) | |
parent | 8da03e01265f229a91aaffb7af2aa2057e08f1b9 (diff) | |
download | docker-py-62af2bbb13cfa413ab3d9e3536c6996474fa4629.tar.gz |
Merge pull request #2846 from shehzaman/feature/missing-identity-file
Put back identityfile parameter from .ssh/config
Diffstat (limited to 'docker/transport')
-rw-r--r-- | docker/transport/sshconn.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docker/transport/sshconn.py b/docker/transport/sshconn.py index 3ca45c4..8e6beb2 100644 --- a/docker/transport/sshconn.py +++ b/docker/transport/sshconn.py @@ -202,7 +202,6 @@ class SSHHTTPAdapter(BaseHTTPAdapter): 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'] @@ -210,9 +209,11 @@ class SSHHTTPAdapter(BaseHTTPAdapter): 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()) |