Merge pull request #1928 from mnottale/fix-spurious-resolution-macos-slowdown

Workaround requests resolving our unix socket URL on macosx.
This commit is contained in:
Joffrey F 2018-02-27 08:58:59 -08:00 committed by GitHub
commit 9b8e022fa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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(

View File

@ -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'