Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment