Skip to content

Commit 9b8e022

Browse files
authored
Merge pull request #1928 from mnottale/fix-spurious-resolution-macos-slowdown
Workaround requests resolving our unix socket URL on macosx.
2 parents fe96676 + 15c26e7 commit 9b8e022

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker/api/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def __init__(self, base_url=None, version=None,
119119
)
120120
self.mount('http+docker://', self._custom_adapter)
121121
self._unmount('http://', 'https://')
122-
self.base_url = 'http+docker://localunixsocket'
122+
# host part of URL should be unused, but is resolved by requests
123+
# module in proxy_bypass_macosx_sysconf()
124+
self.base_url = 'http+docker://localhost'
123125
elif base_url.startswith('npipe://'):
124126
if not IS_WINDOWS_PLATFORM:
125127
raise DockerException(

tests/unit/fake_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def post_fake_network_disconnect():
512512

513513

514514
# Maps real api url to fake response callback
515-
prefix = 'http+docker://localunixsocket'
515+
prefix = 'http+docker://localhost'
516516
if constants.IS_WINDOWS_PLATFORM:
517517
prefix = 'http+docker://localnpipe'
518518

0 commit comments

Comments
 (0)