Skip to content

Commit 8da03e0

Browse files
shehzamanulyssessouza
authored andcommitted
Put back identityfile parameter
Signed-off-by: Shehzaman <[email protected]>
1 parent 96c1272 commit 8da03e0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docker/transport/sshconn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,18 @@ def _create_paramiko_client(self, base_url):
205205
with open(ssh_config_file) as f:
206206
conf.parse(f)
207207
host_config = conf.lookup(base_url.hostname)
208-
self.ssh_conf = host_config
209208
if 'proxycommand' in host_config:
210209
self.ssh_params["sock"] = paramiko.ProxyCommand(
211210
self.ssh_conf['proxycommand']
212211
)
213212
if 'hostname' in host_config:
214213
self.ssh_params['hostname'] = host_config['hostname']
215214
if base_url.port is None and 'port' in host_config:
216-
self.ssh_params['port'] = self.ssh_conf['port']
215+
self.ssh_params['port'] = host_config['port']
217216
if base_url.username is None and 'user' in host_config:
218-
self.ssh_params['username'] = self.ssh_conf['user']
217+
self.ssh_params['username'] = host_config['user']
218+
if 'identityfile' in host_config:
219+
self.ssh_params['key_filename'] = host_config['identityfile']
219220

220221
self.ssh_client.load_system_host_keys()
221222
self.ssh_client.set_missing_host_key_policy(paramiko.WarningPolicy())

0 commit comments

Comments
 (0)