diff options
| author | Chuck Short <chuck.short@canonical.com> | 2012-04-04 12:36:42 -0400 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2012-04-04 10:18:45 -0700 |
| commit | f698eba45752fddddd914892ed2bf1d5ef7e484e (patch) | |
| tree | 563578c184987efcdbf726dd6dd9202392caf42c /nova/tests | |
| parent | cabe27b955918cbfc410ad20cf9244d5ed4439bc (diff) | |
Fix traceback in image cache manager.
When nova is running as a different user, the image
cache manager can cause tracebacks because it is not
able to access the file. This fixes bug: 973377
Change-Id: I7902b024e7d564fbda97ce8532c1de84ab1a4206
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/test_imagecache.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/tests/test_imagecache.py b/nova/tests/test_imagecache.py index 599d99ac9..9cf400320 100644 --- a/nova/tests/test_imagecache.py +++ b/nova/tests/test_imagecache.py @@ -436,6 +436,7 @@ class ImageCacheManagerTestCase(test.TestCase): self.assertEquals(image_cache_manager.corrupt_base_files, []) def test_handle_base_image_used(self): + self.stubs.Set(virtutils, 'chown', lambda x, y: None) img = '123' with self._make_base_file() as fname: @@ -496,6 +497,8 @@ class ImageCacheManagerTestCase(test.TestCase): self.assertEquals(image_cache_manager.corrupt_base_files, []) def test_handle_base_image_checksum_fails(self): + self.stubs.Set(virtutils, 'chown', lambda x, y: None) + img = '123' with self._make_base_file() as fname: @@ -563,6 +566,8 @@ class ImageCacheManagerTestCase(test.TestCase): self.stubs.Set(os.path, 'exists', lambda x: exists(x)) + self.stubs.Set(virtutils, 'chown', lambda x, y: None) + # We need to stub utime as well orig_utime = os.utime self.stubs.Set(os, 'utime', lambda x, y: None) |
