Commit fceef3a8 authored by Anael Beutot's avatar Anael Beutot
Browse files

Fix bad libvirt behaviour.

Sometimes, libvirt tells us too late that a domain has been removed.
parent 5e9fcd31
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -23,7 +23,13 @@ def _vir_tag(func):
            return
        try:
            return func(dom)
        except libvirt.libvirtError:
        except libvirt.libvirtError as exc:
            if 'Domain not found' in str(exc):
                # sometimes, libvirt tells us too late when a domain is removed
                # we just ignore the error and remove the domain
                dom.hypervisor.domains.pop(dom.name)
                dom.tag_db.remove_sub_object(dom.name)
                return
            logger.exception('Unexpected libvirt error')
            dom.hypervisor.handler.virt_connect_restart()