From 4cda8f70686da409eaec962abc9138607686eed7 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Tue, 1 Nov 2011 15:10:45 -0400 Subject: Fixing immediate delete after boot on Libvirt Addresses bug 884858 Change-Id: Ice05193fce7963dd9742b072cdb4b11882032abe --- nova/virt/libvirt/connection.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index f648af733..251d8041b 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -304,18 +304,18 @@ class LibvirtConnection(driver.ComputeDriver): locals()) raise - try: - # NOTE(justinsb): We remove the domain definition. We probably - # would do better to keep it if cleanup=False (e.g. volumes?) - # (e.g. #2 - not losing machines on failure) - virt_dom.undefine() - except libvirt.libvirtError as e: - errcode = e.get_error_code() - LOG.warning(_("Error from libvirt during undefine of " - "%(instance_name)s. Code=%(errcode)s " - "Error=%(e)s") % - locals()) - raise + try: + # NOTE(justinsb): We remove the domain definition. We probably + # would do better to keep it if cleanup=False (e.g. volumes?) + # (e.g. #2 - not losing machines on failure) + virt_dom.undefine() + except libvirt.libvirtError as e: + errcode = e.get_error_code() + LOG.warning(_("Error from libvirt during undefine of " + "%(instance_name)s. Code=%(errcode)s " + "Error=%(e)s") % + locals()) + raise for (network, mapping) in network_info: self.vif_driver.unplug(instance, network, mapping) -- cgit