Merge "VMware: remove unused parameters in imagecache"
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user