From 8f2ff32438f3141e8865b3f5c9e3225ffee4f69b Mon Sep 17 00:00:00 2001 From: zhurong Date: Tue, 11 Jul 2017 12:05:40 +0800 Subject: [PATCH] Fix another upgrade from docker-py to docker place This patch fix the error from nova, when using nova-docker driver: CRITICAL nova Unhandled error: AttributeError: 'module' object has no attribute 'Client' Change-Id: Ie9b2655b2353a40e504ac2e4bd3c59f829d42a39 Partial-Implements: blueprint adopt-docker-py-2.0-api --- nova/virt/zun/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nova/virt/zun/client.py b/nova/virt/zun/client.py index f081eeff2..fcca1cd23 100644 --- a/nova/virt/zun/client.py +++ b/nova/virt/zun/client.py @@ -20,8 +20,7 @@ import inspect from oslo_config import cfg import six -from docker import client -from docker import tls +import docker CONF = cfg.CONF DEFAULT_TIMEOUT_SECONDS = 120 @@ -52,7 +51,7 @@ def filter_data(f): return wrapper -class DockerHTTPClient(client.Client): +class DockerHTTPClient(docker.APIClient): def __init__(self, url='unix://var/run/docker.sock'): if (CONF.docker.cert_file or CONF.docker.key_file): @@ -62,7 +61,7 @@ class DockerHTTPClient(client.Client): if (CONF.docker.ca_file or CONF.docker.api_insecure or client_cert): - ssl_config = tls.TLSConfig( + ssl_config = docker.tls.TLSConfig( client_cert=client_cert, ca_cert=CONF.docker.ca_file, verify=CONF.docker.api_insecure)