diff options
author | Joffrey F <joffrey@docker.com> | 2016-06-08 17:27:25 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-09-08 11:20:48 -0700 |
commit | e6601e2e55fefa4216bcbf5d1f6c8dbbe7053f54 (patch) | |
tree | fd3d60fb9c8450ac4d19a3f4df4e01be3efaa4dc /docker/client.py | |
parent | df50df38f9553641dd970ad77995e8b5a996d4a6 (diff) | |
download | docker-py-e6601e2e55fefa4216bcbf5d1f6c8dbbe7053f54.tar.gz |
Remove default adapters when connecting through a unix socket.1076-dns-fix
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/client.py')
-rw-r--r-- | docker/client.py | 5 |
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) |