utils/QubesWatch: improve error handling (minor)

This commit is contained in:
Marek Marczykowski-Górecki 2015-11-07 00:20:24 +01:00
parent d38883833a
commit 93b7b3cb72
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -750,10 +750,10 @@ class QubesWatch(object):
try:
if vm.isActive():
self._register_watches(vm)
except libvirt.libvirtError:
except libvirt.libvirtError as e:
# this will happen if we loose a race with another tool,
# which can just remove the domain
if vmm.libvirt_conn.virConnGetLastError()[0] == libvirt.VIR_ERR_NO_DOMAIN:
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
pass
raise
# and for dom0