Fix up some feedback on image precache support

This addressed a few feedback items from earlier in the stack.

Related to blueprint image-precache-support

Change-Id: I622a9180d7b53dd35e60e2335fe185da1d6ac019
This commit is contained in:
Dan Smith
2019-10-11 09:10:01 -07:00
parent 3391298706
commit fee9503ead
2 changed files with 7 additions and 2 deletions

View File

@@ -1660,7 +1660,7 @@ class ComputeTaskManager(base.Base):
hosts_by_cell[hmap.cell_mapping.uuid].append(hostname)
LOG.info('Preparing to request pre-caching of image(s) %(image_ids)s '
'on %(hosts)i hosts across %(cells)s cells.',
'on %(hosts)i hosts across %(cells)i cells.',
{'image_ids': ','.join(image_ids),
'hosts': len(aggregate.hosts),
'cells': len(hosts_by_cell)})
@@ -1688,6 +1688,8 @@ class ComputeTaskManager(base.Base):
fetch_pool.waitall()
clock.stop()
# FIXME(danms): Calculate some interesting statistics about the image
# download process to log for the admin.
LOG.info('Image pre-cache operation for image(s) %(image_ids)s '
'completed in %(time).2f seconds',
{'image_ids': ','.join(image_ids),

View File

@@ -23561,7 +23561,10 @@ class LibvirtDriverTestCase(test.NoDBTestCase, TraitsComparisonMixin):
else:
mock_et.assert_not_called()
def test_cache_image_existing_first_time(self):
def test_cache_image_uncached_first_time(self):
# Test the case where we do need to download the image,
# and this is the first time an image cache operation has ever
# been performed, so the directory structure has to be created.
self.test_cache_image_uncached(first_time=True)
@mock.patch('oslo_utils.fileutils.ensure_tree')