diff --git a/zun/compute/manager.py b/zun/compute/manager.py index bae8b4d2e..d4d2557c8 100755 --- a/zun/compute/manager.py +++ b/zun/compute/manager.py @@ -76,7 +76,7 @@ class Manager(object): context, repo, tag, sandbox_image_pull_policy, sandbox_image_driver) if not image_loaded: - self.driver.load_image(sandbox_image, image['path']) + self.driver.load_image(image['path']) sandbox_id = self.driver.create_sandbox(context, container, image=sandbox_image) except Exception as e: @@ -97,7 +97,7 @@ class Manager(object): image, image_loaded = image_driver.pull_image( context, repo, tag, image_pull_policy, image_driver_name) if not image_loaded: - self.driver.load_image(container.image, image['path']) + self.driver.load_image(image['path']) except exception.ImageNotFound as e: with excutils.save_and_reraise_exception(reraise=reraise): LOG.error(six.text_type(e)) @@ -472,7 +472,7 @@ class Manager(object): pulled_image, image_loaded = image_driver.pull_image( context, image.repo, image.tag) if not image_loaded: - self.driver.load_image(repo_tag, pulled_image['path']) + self.driver.load_image(pulled_image['path']) image_dict = self.driver.inspect_image(repo_tag) image.image_id = image_dict['Id'] image.size = image_dict['Size'] diff --git a/zun/container/docker/driver.py b/zun/container/docker/driver.py index 555004dab..6583904b0 100644 --- a/zun/container/docker/driver.py +++ b/zun/container/docker/driver.py @@ -45,7 +45,7 @@ class DockerDriver(driver.ContainerDriver): def __init__(self): super(DockerDriver, self).__init__() - def load_image(self, image, image_path=None): + def load_image(self, image_path=None): with docker_utils.docker_client() as docker: if image_path: with open(image_path, 'rb') as fd: diff --git a/zun/tests/unit/compute/test_compute_manager.py b/zun/tests/unit/compute/test_compute_manager.py index f18b23441..1b6794590 100755 --- a/zun/tests/unit/compute/test_compute_manager.py +++ b/zun/tests/unit/compute/test_compute_manager.py @@ -511,7 +511,7 @@ class TestManager(base.TestCase): mock_pull.assert_any_call(self.context, image.repo, image.tag) mock_save.assert_called_once() mock_inspect.assert_called_once_with(repo_tag) - mock_load.assert_called_once_with(repo_tag, ret['path']) + mock_load.assert_called_once_with(ret['path']) @mock.patch.object(fake_driver, 'execute_resize') def test_container_exec_resize(self, mock_resize): diff --git a/zun/tests/unit/container/docker/test_docker_driver.py b/zun/tests/unit/container/docker/test_docker_driver.py index 3c12663b5..ee0a19921 100644 --- a/zun/tests/unit/container/docker/test_docker_driver.py +++ b/zun/tests/unit/container/docker/test_docker_driver.py @@ -65,8 +65,7 @@ class TestDockerDriver(base.DriverTestCase): self.mock_docker.load_image = mock.Mock() mock_open_file = mock.mock_open() with mock.patch('zun.container.docker.driver.open', mock_open_file): - mock_image = mock.MagicMock() - self.driver.load_image(mock_image, 'test') + self.driver.load_image('test') self.mock_docker.load_image.assert_called_once_with( mock_open_file.return_value)