aboutsummaryrefslogtreecommitdiff
path: root/kolla
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-30 20:06:59 +0000
committerGerrit Code Review <review@openstack.org>2017-06-30 20:06:59 +0000
commit2548c67ad906ad74edd0517a14cda5ddba0fe2a3 (patch)
treefd09ffba1462ad7989febfaa0ae0875169c0e69e /kolla
parent21668b3b9d242681eb8c4e5952df232a2a629941 (diff)
parent7e2486c3d9edc94300a58f5e8203277fd5d7e01d (diff)
downloadkolla-2548c67ad906ad74edd0517a14cda5ddba0fe2a3.tar.gz
kolla-2548c67ad906ad74edd0517a14cda5ddba0fe2a3.zip
Merge "Upgrade from docker-py to docker"
Diffstat (limited to 'kolla')
-rwxr-xr-xkolla/image/build.py2
-rw-r--r--kolla/tests/test_build.py16
2 files changed, 9 insertions, 9 deletions
diff --git a/kolla/image/build.py b/kolla/image/build.py
index 262513a2e..bbcb53829 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -132,7 +132,7 @@ class DockerTask(task.Task):
if self._dc is not None:
return self._dc
docker_kwargs = self.docker_kwargs.copy()
- self._dc = docker.Client(version='auto', **docker_kwargs)
+ self._dc = docker.APIClient(version='auto', **docker_kwargs)
return self._dc
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index 0c50db98b..c1d17cfdb 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -58,7 +58,7 @@ class TasksTest(base.TestCase):
self.imageChild.path = self.useFixture(fixtures.TempDir()).path
@mock.patch.dict(os.environ, clear=True)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_push_image(self, mock_client):
self.dc = mock_client
pusher = build.PushTask(self.conf, self.image)
@@ -67,7 +67,7 @@ class TasksTest(base.TestCase):
self.image.canonical_name, stream=True, insecure_registry=True)
@mock.patch.dict(os.environ, clear=True)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_build_image(self, mock_client):
self.dc = mock_client
push_queue = mock.Mock()
@@ -82,7 +82,7 @@ class TasksTest(base.TestCase):
self.assertTrue(builder.success)
@mock.patch.dict(os.environ, clear=True)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_build_image_with_build_arg(self, mock_client):
self.dc = mock_client
build_args = {
@@ -103,7 +103,7 @@ class TasksTest(base.TestCase):
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
clear=True)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_build_arg_from_env(self, mock_client):
push_queue = mock.Mock()
self.dc = mock_client
@@ -122,7 +122,7 @@ class TasksTest(base.TestCase):
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
clear=True)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_build_arg_precedence(self, mock_client):
self.dc = mock_client
build_args = {
@@ -141,7 +141,7 @@ class TasksTest(base.TestCase):
self.assertTrue(builder.success)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
@mock.patch('requests.get')
def test_requests_get_timeout(self, mock_get, mock_client):
self.dc = mock_client
@@ -162,7 +162,7 @@ class TasksTest(base.TestCase):
self.assertFalse(builder.success)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
@mock.patch('requests.get')
@mock.patch('shutil.rmtree')
@mock.patch('shutil.copyfile')
@@ -192,7 +192,7 @@ class TasksTest(base.TestCase):
else:
self.assertIsNotNone(get_result)
- @mock.patch('docker.Client')
+ @mock.patch('docker.APIClient')
def test_followups_docker_image(self, mock_client):
self.imageChild.source = {
'source': 'http://fake/source',