summaryrefslogtreecommitdiff
path: root/docker/api
diff options
context:
space:
mode:
authoraiordache <anca.iordache@docker.com>2020-09-22 10:20:18 +0200
committeraiordache <anca.iordache@docker.com>2020-10-13 10:42:38 +0200
commit180414dcbbde807f85695a03a5c12d5ffc3aa6f3 (patch)
treee2dd84c79931cf46e08a50d070a2b823be8606f9 /docker/api
parent9d8cd023e88f22e701365ae4d3dccc16537f4851 (diff)
downloaddocker-py-180414dcbbde807f85695a03a5c12d5ffc3aa6f3.tar.gz
Shell out to SSH client for an ssh connection
Signed-off-by: aiordache <anca.iordache@docker.com>
Diffstat (limited to 'docker/api')
-rw-r--r--docker/api/client.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/docker/api/client.py b/docker/api/client.py
index 43e309b..1edd434 100644
--- a/docker/api/client.py
+++ b/docker/api/client.py
@@ -89,6 +89,9 @@ class APIClient(
user_agent (str): Set a custom user agent for requests to the server.
credstore_env (dict): Override environment variables when calling the
credential store process.
+ use_ssh_client (bool): If set to `True`, an ssh connection is made
+ via shelling out to the ssh client. Ensure the ssh client is
+ installed and configured on the host.
"""
__attrs__ = requests.Session.__attrs__ + ['_auth_configs',
@@ -100,7 +103,7 @@ class APIClient(
def __init__(self, base_url=None, version=None,
timeout=DEFAULT_TIMEOUT_SECONDS, tls=False,
user_agent=DEFAULT_USER_AGENT, num_pools=None,
- credstore_env=None):
+ credstore_env=None, use_ssh_client=False):
super(APIClient, self).__init__()
if tls and not base_url:
@@ -161,7 +164,8 @@ class APIClient(
elif base_url.startswith('ssh://'):
try:
self._custom_adapter = SSHHTTPAdapter(
- base_url, timeout, pool_connections=num_pools
+ base_url, timeout, pool_connections=num_pools,
+ shell_out=use_ssh_client
)
except NameError:
raise DockerException(