summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-02-26 14:44:20 -0500
committerDan Prince <dprince@redhat.com>2012-02-26 14:45:31 -0500
commitdd6852992b9b63e0cfb387e20f1dae4490c7ead3 (patch)
tree13e5d574dbb407537f31848f166aff45992551fc
parente60398ba2ce95a0cd36ecfedb5a2df57552b2f82 (diff)
Cleanup .rescue files in libvirt driver unrescue.
Updates the libvirt driver so that it cleans up the .rescue image files in an unrescue operation. Fixes LP Bug #941591. Change-Id: Ib9f66834b8189912ec8408eeeb0d4ef35d41d39a
-rw-r--r--nova/virt/libvirt/connection.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index 556607666..c531c2cc8 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -41,6 +41,7 @@ Supports KVM, LXC, QEMU, UML, and XEN.
import hashlib
import functools
+import glob
import multiprocessing
import os
import shutil
@@ -749,6 +750,10 @@ class LibvirtConnection(driver.ComputeDriver):
unrescue_xml = libvirt_utils.load_file(unrescue_xml_path)
libvirt_utils.file_delete(unrescue_xml_path)
self.reboot(instance, network_info, xml=unrescue_xml)
+ rescue_files = os.path.join(FLAGS.instances_path, instance['name'],
+ "*.rescue")
+ for rescue_file in glob.iglob(rescue_files):
+ libvirt_utils.file_delete(rescue_file)
@exception.wrap_exception()
def poll_rebooting_instances(self, timeout):