Workaround requests resolving our unix socket URL on macosx.

Signed-off-by: Matthieu Nottale <matthieu.nottale@docker.com>
This commit is contained in:
Matthieu Nottale 2018-02-26 14:37:27 +01:00
parent 8b246db271
commit 15c26e7057
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'