Merge "VMware: remove unused parameters in imagecache"

This commit is contained in:
Jenkins
2014-06-17 14:48:11 +00:00
committed by Gerrit Code Review
3 changed files with 5 additions and 10 deletions
+3 -6
View File
@@ -61,13 +61,11 @@ class ImageCacheManagerTestCase(test.NoDBTestCase):
) as (_get_timestamp, _file_delete):
self.exists = False
self._imagecache.timestamp_cleanup(
'fake-dc-ref', 'fake-ds-browser', 'fake-ds-ref',
'fake-ds-name', 'fake-ds-path')
'fake-dc-ref', 'fake-ds-browser', 'fake-ds-path')
self.assertEqual(0, _file_delete.call_count)
self.exists = True
self._imagecache.timestamp_cleanup(
'fake-dc-ref', 'fake-ds-browser', 'fake-ds-ref',
'fake-ds-name', 'fake-ds-path')
'fake-dc-ref', 'fake-ds-browser', 'fake-ds-path')
_file_delete.assert_called_once_with(self._session,
'fake-ds-path/ts-2012-11-22-12-00-00',
'fake-dc-ref')
@@ -169,8 +167,7 @@ class ImageCacheManagerTestCase(test.NoDBTestCase):
def fake_file_delete(session, path, dc_ref):
self.assertEqual('fake-ds-path/fake-image-3', path)
def fake_timestamp_cleanup(dc_ref, ds_browser,
ds_ref, ds_name, path):
def fake_timestamp_cleanup(dc_ref, ds_browser, path):
self.assertEqual('fake-ds-path/fake-image-4', path)
with contextlib.nested(
+1 -3
View File
@@ -80,8 +80,7 @@ class ImageCacheManager(imagecache.ImageCacheManager):
"""Returns the timestamp folder."""
return '%s/%s' % (ds_path, image_id)
def timestamp_cleanup(self, dc_ref, ds_browser,
ds_ref, ds_name, ds_path):
def timestamp_cleanup(self, dc_ref, ds_browser, ds_path):
ts = self._get_timestamp(ds_browser, ds_path)
if ts:
ts_path = '%s/%s' % (ds_path, ts)
@@ -163,7 +162,6 @@ class ImageCacheManager(imagecache.ImageCacheManager):
with lockutils.lock(path, lock_file_prefix='nova-vmware-ts',
external=True):
self.timestamp_cleanup(dc_info.ref, ds_browser,
datastore['ref'], datastore['name'],
path)
def update(self, context, instances, datastores_info):
+1 -1
View File
@@ -315,7 +315,7 @@ class VMwareVMOps(object):
with lockutils.lock(path, lock_file_prefix='nova-vmware-ts',
external=True):
self._imagecache.timestamp_cleanup(dc_info.ref, ds_browser,
data_store_ref, data_store_name, path)
path)
# Check if the image exists in the datastore cache. If not the
# image will be uploaded and cached.