From dfe68b33d6723a29fb2a4d3bb6d49c444be921c9 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 2 Oct 2017 15:22:00 +0530 Subject: [PATCH] Handle docker running on localhost. --- tests/testlib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testlib.py b/tests/testlib.py index 4e8f7fc6..e60d21d1 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -56,6 +56,9 @@ class DockerizedSshDaemon(object): self.host = self.get_host() def get_host(self): + if self.docker.api.base_url == 'http+docker://localunixsocket': + return 'localhost' + parsed = urlparse.urlparse(self.docker.api.base_url) return parsed.netloc.partition(':')[0]