summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShehzaman <shehzi.1@gmail.com>2021-05-27 00:11:38 +0530
committerUlysses Souza <ulyssessouza@gmail.com>2021-08-31 09:23:44 -0300
commit8da03e01265f229a91aaffb7af2aa2057e08f1b9 (patch)
treee5b1a0516a96d9117dbe01cdb8e7d4c100f12c37
parent96c12726fdb9b24e985b4de74d5c82145ccd8185 (diff)
downloaddocker-py-8da03e01265f229a91aaffb7af2aa2057e08f1b9.tar.gz
Put back identityfile parameter
Signed-off-by: Shehzaman <shehzi.1@gmail.com>
-rw-r--r--docker/transport/sshconn.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/docker/transport/sshconn.py b/docker/transport/sshconn.py
index fb5c6bb..e08e3a8 100644
--- a/docker/transport/sshconn.py
+++ b/docker/transport/sshconn.py
@@ -205,7 +205,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']
@@ -213,9 +212,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())