Handle docker running on localhost.

This commit is contained in:
David Wilson 2017-10-02 15:22:00 +05:30
parent 21b65e61af
commit e3b51de6b1
1 changed files with 3 additions and 0 deletions

View File

@ -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]