summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Nottale <matthieu.nottale@docker.com>2018-02-26 14:37:27 +0100
committerMatthieu Nottale <matthieu.nottale@docker.com>2018-02-26 14:47:26 +0100
commit15c26e7057b6b7a95297c3324ddf5cbe7dad4353 (patch)
treeeb72e601da0956e9ac43b941a21829830afbe76b
parent8b246db271a85d6541dc458838627e89c683e42f (diff)
downloaddocker-py-15c26e7057b6b7a95297c3324ddf5cbe7dad4353.tar.gz
Workaround requests resolving our unix socket URL on macosx.
Signed-off-by: Matthieu Nottale <matthieu.nottale@docker.com>
-rw-r--r--docker/api/client.py4
-rw-r--r--tests/unit/fake_api.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/docker/api/client.py b/docker/api/client.py
index bddab61..13c292a 100644
--- a/docker/api/client.py
+++ b/docker/api/client.py
@@ -119,7 +119,9 @@ class APIClient(
)
self.mount('http+docker://', self._custom_adapter)
self._unmount('http://', 'https://')
- self.base_url = 'http+docker://localunixsocket'
+ # host part of URL should be unused, but is resolved by requests
+ # module in proxy_bypass_macosx_sysconf()
+ self.base_url = 'http+docker://localhost'
elif base_url.startswith('npipe://'):
if not IS_WINDOWS_PLATFORM:
raise DockerException(
diff --git a/tests/unit/fake_api.py b/tests/unit/fake_api.py
index 63d7331..e609b64 100644
--- a/tests/unit/fake_api.py
+++ b/tests/unit/fake_api.py
@@ -512,7 +512,7 @@ def post_fake_network_disconnect():
# Maps real api url to fake response callback
-prefix = 'http+docker://localunixsocket'
+prefix = 'http+docker://localhost'
if constants.IS_WINDOWS_PLATFORM:
prefix = 'http+docker://localnpipe'