Merge "Remove unused parameter in docker_load"

This commit is contained in:
Jenkins 2017-05-14 06:57:17 +00:00 committed by Gerrit Code Review
commit 7813ffd875
4 changed files with 6 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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