Skip to content

Commit

Permalink
Cleanup .rescue files in libvirt driver unrescue.
Browse files Browse the repository at this point in the history
Updates the libvirt driver so that it cleans up the .rescue
image files in an unrescue operation.

Fixes LP Bug #941591.

Change-Id: Ib9f66834b8189912ec8408eeeb0d4ef35d41d39a
  • Loading branch information
dprince committed Feb 26, 2012
1 parent e60398b commit dd68529
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nova/virt/libvirt/connection.py
Expand Up @@ -41,6 +41,7 @@

import hashlib
import functools
import glob
import multiprocessing
import os
import shutil
Expand Down Expand Up @@ -749,6 +750,10 @@ def unrescue(self, instance, network_info):
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):
Expand Down

0 comments on commit dd68529

Please sign in to comment.