Handle tcp:// URLs

This means docker-py will do the Right Thing if the base url is set
using the new `DOCKER_HOST` environment variable, for example.
(http://docs.docker.io/en/latest/commandline/cli/)
This commit is contained in:
Aanand Prasad 2014-01-14 17:14:27 +00:00
parent 2ac5cca84d
commit 96932fc1cb
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,8 @@ class Client(requests.Session):
super(Client, self).__init__()
if base_url.startswith('unix:///'):
base_url = base_url.replace('unix:/', 'unix:')
if base_url.startswith('tcp:'):
base_url = base_url.replace('tcp:', 'http:')
if base_url.endswith('/'):
base_url = base_url[:-1]
self.base_url = base_url