From b9e47884e16ea6516769bf9f454fd66922a4282c Mon Sep 17 00:00:00 2001 From: Michael Still Date: Sat, 18 Feb 2012 12:14:52 +1100 Subject: Improve unit test coverage per bug/934566. bug/934566 identified an error which should have been caught by more complete unit test coverage. This review extends unit test coverage and is one of a series I will be sending. Change-Id: I76b966fc2bf18940d0dc0475f3776f8a3148a78d --- nova/virt/libvirt/imagecache.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/imagecache.py b/nova/virt/libvirt/imagecache.py index 6e5581d84..bd714ea7f 100644 --- a/nova/virt/libvirt/imagecache.py +++ b/nova/virt/libvirt/imagecache.py @@ -232,6 +232,11 @@ class ImageCacheManager(object): Returns nothing. """ + if not os.path.exists(base_file): + LOG.debug(_('Cannot remove %(base_file)s, it does not exist'), + base_file) + return + mtime = os.path.getmtime(base_file) age = time.time() - mtime -- cgit