From 9180a8cb218ab4e1512859bae7540828bf5b471e Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 19 Jun 2017 20:38:35 +0000 Subject: [PATCH] Upgrade from docker-py to docker The docker python binding library has renamed from "docker-py" to "docker" . This commit will adopt the latest package. After this commit is merged, devstack users needs to perform the following steps: $ sudo pip uninstall docker-py docker-pycreds $ sudo pip install -c /opt/stack/requirements/upper-constraints.txt \ -e /opt/stack/zun $ sudo systemctl restart devstack@zun* Depends-On: I9346112d8a495bc6b304647377f8da47017cc869 Depends-On: I0a6fdb905016ff064d90b3170c3bcf90311aaaad Change-Id: I3d952f647f8235079f717256750c90cb9ddf9588 Partial-Implements: blueprint adopt-docker-py-2.0-api Closes-Bug: #1671874 Closes-Bug: #1693425 --- requirements.txt | 2 +- zun/container/docker/utils.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index f74dbe63c..6db2424de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,5 +31,5 @@ six>=1.9.0 # MIT WSME>=0.8 # MIT SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT stevedore>=1.20.0 # Apache-2.0 -docker-py>=1.8.1 # Apache-2.0 +docker>=2.0.0 # Apache-2.0 netaddr!=0.7.16,>=0.7.13 # BSD diff --git a/zun/container/docker/utils.py b/zun/container/docker/utils.py index c7f42cbce..d0f06ae1c 100644 --- a/zun/container/docker/utils.py +++ b/zun/container/docker/utils.py @@ -12,9 +12,8 @@ import contextlib import six -from docker import client +import docker from docker import errors -from docker import tls from zun.common import exception import zun.conf @@ -41,7 +40,7 @@ def docker_client(): raise exception.DockerError(error_msg=six.text_type(e)) -class DockerHTTPClient(client.Client): +class DockerHTTPClient(docker.APIClient): def __init__(self, url=CONF.docker.api_url, ver=CONF.docker.docker_remote_api_version, timeout=CONF.docker.default_timeout, @@ -50,7 +49,7 @@ class DockerHTTPClient(client.Client): client_cert=None): if ca_cert and client_key and client_cert: - ssl_config = tls.TLSConfig( + ssl_config = docker.tls.TLSConfig( client_cert=(client_cert, client_key), verify=ca_cert, assert_hostname=False,