From 38bc2d329581bf85d131e0025a13c7e87ea9f107 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Wed, 28 Mar 2012 15:00:45 +1100 Subject: Base image signature files are not images. Stop treating base image signature files as images. Resolves bug 967843. Change-Id: Iad2f27e07a6a9887785bb4dab44476c62cd11a69 --- nova/tests/test_imagecache.py | 1 + nova/virt/libvirt/imagecache.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/tests/test_imagecache.py b/nova/tests/test_imagecache.py index 09f5f9fce..373f8478b 100644 --- a/nova/tests/test_imagecache.py +++ b/nova/tests/test_imagecache.py @@ -77,6 +77,7 @@ class ImageCacheManagerTestCase(test.TestCase): 'e97222e91fc4241f49a7f520d1dcf446751129b3', '17d1b00b81642842e514494a78e804e9a511637c', '17d1b00b81642842e514494a78e804e9a511637c_5368709120', + '17d1b00b81642842e514494a78e804e9a511637c_5368709120.sha1', '17d1b00b81642842e514494a78e804e9a511637c_10737418240', '00000004'] diff --git a/nova/virt/libvirt/imagecache.py b/nova/virt/libvirt/imagecache.py index 07bab5cd3..092ab1d05 100644 --- a/nova/virt/libvirt/imagecache.py +++ b/nova/virt/libvirt/imagecache.py @@ -134,7 +134,9 @@ class ImageCacheManager(object): if len(ent) == digest_size: self._store_image(base_dir, ent, original=True) - elif len(ent) > digest_size + 2 and ent[digest_size] == '_': + elif (len(ent) > digest_size + 2 and + ent[digest_size] == '_' and + not ent.endswith('.sha1')): self._store_image(base_dir, ent, original=False) def _list_running_instances(self, context): -- cgit