summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <f.joffrey@gmail.com>2018-02-27 08:58:59 -0800
committerGitHub <noreply@github.com>2018-02-27 08:58:59 -0800
commit9b8e022fa1012cae381bb97823e30936877c57c3 (patch)
tree7c9121365b83142228da01bea1265bbba2c927e1
parentfe966764ef597c5260e25d1806a0077883740fd1 (diff)
parent15c26e7057b6b7a95297c3324ddf5cbe7dad4353 (diff)
downloaddocker-py-9b8e022fa1012cae381bb97823e30936877c57c3.tar.gz
Merge pull request #1928 from mnottale/fix-spurious-resolution-macos-slowdown
Workaround requests resolving our unix socket URL on macosx.
-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'