diff --git a/ChangeLog.md b/ChangeLog.md index 29651c69..1732283d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,11 @@ ChangeLog ========= +0.1.4 +----- + +* Added support for API connection through UNIX socket (default for docker 0.5.2+) + 0.1.3 ----- diff --git a/README.md b/README.md index 8830de4b..76734166 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ An API client for docker written in Python API === -`docker.Client(base_url='http://localhost:4243', version="1.3")` +`docker.Client(base_url='unix://var/run/docker.sock', version="1.3")` Client class. `base_url` refers to the protocol+hostname+port where the docker server is hosted. Version is the version of the API the client will use. diff --git a/docker/client.py b/docker/client.py index 101d3a00..892e63fb 100644 --- a/docker/client.py +++ b/docker/client.py @@ -31,7 +31,6 @@ class UnixHTTPConnection(httplib.HTTPConnection, object): sock.connect(self.base_url.replace("unix:/","")) self.sock = sock - def _extract_path(self, url): #remove the base_url entirely.. return url.replace(self.base_url, "") @@ -50,6 +49,7 @@ class UnixHTTPConnectionPool(HTTPConnectionPool): def _new_conn(self): return UnixHTTPConnection(self.base_url, self.socket_path) + class UnixAdapter(HTTPAdapter): def __init__(self, base_url): self.base_url = base_url @@ -73,7 +73,6 @@ class Client(requests.Session): def _url(self, path): return '{0}/v{1}{2}'.format(self.base_url, self._version, path) - def _raise_for_status(self, response): """Raises stored :class:`HTTPError`, if one occurred.""" http_error_msg = '' diff --git a/setup.py b/setup.py index e8260762..c5017515 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ SOURCE_DIR = os.path.join(ROOT_DIR) test_requirements = [] setup( name="docker-py", - version='0.1.3', + version='0.1.4', description="Python client for Docker.", packages=['docker'], install_requires=['requests', 'six'] + test_requirements,