From e6601e2e55fefa4216bcbf5d1f6c8dbbe7053f54 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 8 Jun 2016 17:27:25 -0700 Subject: Remove default adapters when connecting through a unix socket. Signed-off-by: Joffrey F --- docker/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/client.py b/docker/client.py index b811d36..6e8b278 100644 --- a/docker/client.py +++ b/docker/client.py @@ -60,6 +60,7 @@ class Client( if base_url.startswith('http+unix://'): self._custom_adapter = UnixAdapter(base_url, timeout) self.mount('http+docker://', self._custom_adapter) + self._unmount('http://', 'https://') self.base_url = 'http+docker://localunixsocket' elif base_url.startswith('npipe://'): if not constants.IS_WINDOWS_PLATFORM: @@ -368,6 +369,10 @@ class Client( [x for x in self._multiplexed_buffer_helper(res)] ) + def _unmount(self, *args): + for proto in args: + self.adapters.pop(proto) + def get_adapter(self, url): try: return super(Client, self).get_adapter(url) -- cgit v1.2.1