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
This commit is contained in:
Hongbin Lu 2017-06-19 20:38:35 +00:00
parent 9051099e39
commit 9180a8cb21
2 changed files with 4 additions and 5 deletions

View File

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

View File

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