summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-20 19:25:54 +0000
committerGerrit Code Review <review@openstack.org>2012-07-20 19:25:54 +0000
commitfca17aabc3864a564bf0f895a8717bec526d57c3 (patch)
tree0671168653074323e328fa4a4c8fc3d131f1da51 /nova
parent0cf65957335100dc7ddfa864e4965f85946e79f6 (diff)
parent9c16f2a05245bc0a6ae0af5f8edbde65ba812837 (diff)
Merge "Don't let failure to delete filesystem block deletion of instances in libvirt"
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/libvirt/driver.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 325569f8a..6c5cf38f3 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -551,7 +551,14 @@ class LibvirtDriver(driver.ComputeDriver):
if FLAGS.libvirt_type == 'lxc':
disk.destroy_container(self.container)
if os.path.exists(target):
- shutil.rmtree(target)
+ # If we fail to get rid of the directory
+ # tree, this shouldn't block deletion of
+ # the instance as whole.
+ try:
+ shutil.rmtree(target)
+ except OSError, e:
+ LOG.error(_("Failed to cleanup directory %(target)s: %(e)s") %
+ locals())
#NOTE(bfilippov): destroy all LVM disks for this instance
self._cleanup_lvm(instance)