Merge "Upgrade from docker-py to docker"
This commit is contained in:
commit
2548c67ad9
@ -21,7 +21,7 @@ RUN /bin/true
|
|||||||
{{ macros.install_packages(dind_packages | customizable("packages")) }}
|
{{ macros.install_packages(dind_packages | customizable("packages")) }}
|
||||||
|
|
||||||
{% set dind_pip_packages = [
|
{% set dind_pip_packages = [
|
||||||
'docker-py'
|
'docker'
|
||||||
] %}
|
] %}
|
||||||
|
|
||||||
RUN {{ macros.install_pip(dind_pip_packages | customizable("pip_packages"), constraints = false) }}
|
RUN {{ macros.install_pip(dind_pip_packages | customizable("pip_packages"), constraints = false) }}
|
||||||
|
@ -132,7 +132,7 @@ class DockerTask(task.Task):
|
|||||||
if self._dc is not None:
|
if self._dc is not None:
|
||||||
return self._dc
|
return self._dc
|
||||||
docker_kwargs = self.docker_kwargs.copy()
|
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
|
return self._dc
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class TasksTest(base.TestCase):
|
|||||||
self.imageChild.path = self.useFixture(fixtures.TempDir()).path
|
self.imageChild.path = self.useFixture(fixtures.TempDir()).path
|
||||||
|
|
||||||
@mock.patch.dict(os.environ, clear=True)
|
@mock.patch.dict(os.environ, clear=True)
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
def test_push_image(self, mock_client):
|
def test_push_image(self, mock_client):
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
pusher = build.PushTask(self.conf, self.image)
|
pusher = build.PushTask(self.conf, self.image)
|
||||||
@ -67,7 +67,7 @@ class TasksTest(base.TestCase):
|
|||||||
self.image.canonical_name, stream=True, insecure_registry=True)
|
self.image.canonical_name, stream=True, insecure_registry=True)
|
||||||
|
|
||||||
@mock.patch.dict(os.environ, clear=True)
|
@mock.patch.dict(os.environ, clear=True)
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
def test_build_image(self, mock_client):
|
def test_build_image(self, mock_client):
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
push_queue = mock.Mock()
|
push_queue = mock.Mock()
|
||||||
@ -82,7 +82,7 @@ class TasksTest(base.TestCase):
|
|||||||
self.assertTrue(builder.success)
|
self.assertTrue(builder.success)
|
||||||
|
|
||||||
@mock.patch.dict(os.environ, clear=True)
|
@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):
|
def test_build_image_with_build_arg(self, mock_client):
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
build_args = {
|
build_args = {
|
||||||
@ -103,7 +103,7 @@ class TasksTest(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
|
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
|
||||||
clear=True)
|
clear=True)
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
def test_build_arg_from_env(self, mock_client):
|
def test_build_arg_from_env(self, mock_client):
|
||||||
push_queue = mock.Mock()
|
push_queue = mock.Mock()
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
@ -122,7 +122,7 @@ class TasksTest(base.TestCase):
|
|||||||
|
|
||||||
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
|
@mock.patch.dict(os.environ, {'http_proxy': 'http://FROM_ENV:8080'},
|
||||||
clear=True)
|
clear=True)
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
def test_build_arg_precedence(self, mock_client):
|
def test_build_arg_precedence(self, mock_client):
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
build_args = {
|
build_args = {
|
||||||
@ -141,7 +141,7 @@ class TasksTest(base.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(builder.success)
|
self.assertTrue(builder.success)
|
||||||
|
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
@mock.patch('requests.get')
|
@mock.patch('requests.get')
|
||||||
def test_requests_get_timeout(self, mock_get, mock_client):
|
def test_requests_get_timeout(self, mock_get, mock_client):
|
||||||
self.dc = mock_client
|
self.dc = mock_client
|
||||||
@ -162,7 +162,7 @@ class TasksTest(base.TestCase):
|
|||||||
|
|
||||||
self.assertFalse(builder.success)
|
self.assertFalse(builder.success)
|
||||||
|
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
@mock.patch('requests.get')
|
@mock.patch('requests.get')
|
||||||
@mock.patch('shutil.rmtree')
|
@mock.patch('shutil.rmtree')
|
||||||
@mock.patch('shutil.copyfile')
|
@mock.patch('shutil.copyfile')
|
||||||
@ -192,7 +192,7 @@ class TasksTest(base.TestCase):
|
|||||||
else:
|
else:
|
||||||
self.assertIsNotNone(get_result)
|
self.assertIsNotNone(get_result)
|
||||||
|
|
||||||
@mock.patch('docker.Client')
|
@mock.patch('docker.APIClient')
|
||||||
def test_followups_docker_image(self, mock_client):
|
def test_followups_docker_image(self, mock_client):
|
||||||
self.imageChild.source = {
|
self.imageChild.source = {
|
||||||
'source': 'http://fake/source',
|
'source': 'http://fake/source',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||||
docker-py>=1.8.1 # Apache-2.0
|
docker>=2.0.0 # Apache-2.0
|
||||||
Jinja2!=2.9.0,!=2.9.1,!=2.9.2,!=2.9.3,!=2.9.4,>=2.8 # BSD License (3 clause)
|
Jinja2!=2.9.0,!=2.9.1,!=2.9.2,!=2.9.3,!=2.9.4,>=2.8 # BSD License (3 clause)
|
||||||
gitdb>=0.6.4 # BSD License (3 clause)
|
gitdb>=0.6.4 # BSD License (3 clause)
|
||||||
GitPython>=1.0.1 # BSD License (3 clause)
|
GitPython>=1.0.1 # BSD License (3 clause)
|
||||||
|
@ -151,7 +151,7 @@ function setup_ansible {
|
|||||||
mkdir /tmp/kolla
|
mkdir /tmp/kolla
|
||||||
|
|
||||||
# TODO(SamYaple): Move to virtualenv
|
# TODO(SamYaple): Move to virtualenv
|
||||||
sudo -H pip install -U "ansible>=2" "docker-py>=1.6.0" "python-openstackclient" "python-neutronclient"
|
sudo -H pip install -U "ansible>=2" "docker>=2.0.0" "python-openstackclient" "python-neutronclient"
|
||||||
detect_distro
|
detect_distro
|
||||||
|
|
||||||
setup_inventory
|
setup_inventory
|
||||||
|
Loading…
Reference in New Issue
Block a user