summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2016-06-08 17:27:25 -0700
committerJoffrey F <joffrey@docker.com>2016-09-08 11:20:48 -0700
commite6601e2e55fefa4216bcbf5d1f6c8dbbe7053f54 (patch)
treefd3d60fb9c8450ac4d19a3f4df4e01be3efaa4dc
parentdf50df38f9553641dd970ad77995e8b5a996d4a6 (diff)
downloaddocker-py-1076-dns-fix.tar.gz
Remove default adapters when connecting through a unix socket.1076-dns-fix
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r--docker/client.py5
1 files changed, 5 insertions, 0 deletions
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)