From 1501a4e4f75efb63385a1dadc728c2ef245bf7de Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 14 Feb 2013 10:37:21 +0000 Subject: remove intermediate libvirt downloaded images * nova/virt/images.py (fetch_to_raw): When converting a downloaded image to raw, ensure we delete the original download image. I.E. the .part file. The regression was introduced in 7c265343. * nova/tests/test_libvirt.py (test_fetch_raw_image): A new test for this function which wasn't tested previously. Fixes bug: 1125068 Change-Id: Ie6f2cff1a554b8500fd66f0832566ae1b317be40 --- nova/virt/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/virt') diff --git a/nova/virt/images.py b/nova/virt/images.py index a5c960486..b5ca8fa47 100755 --- a/nova/virt/images.py +++ b/nova/virt/images.py @@ -225,6 +225,7 @@ def fetch_to_raw(context, image_href, path, user_id, project_id): LOG.debug("%s was %s, converting to raw" % (image_href, fmt)) with utils.remove_path_on_error(staged): convert_image(path_tmp, staged, 'raw') + os.unlink(path_tmp) data = qemu_img_info(staged) if data.file_format != "raw": @@ -233,6 +234,5 @@ def fetch_to_raw(context, image_href, path, user_id, project_id): data.file_format) os.rename(staged, path) - else: os.rename(path_tmp, path) -- cgit