tests: make test cleanup more defensive - qubes.xml load failure
If qubes.xml doesn't even load, remove it anyway and clean up the VMs the hard way.
This commit is contained in:
parent
9633573408
commit
1b69f5c213
@ -512,8 +512,14 @@ class SystemTestsMixin(object):
|
|||||||
|
|
||||||
# first, remove them Qubes-way
|
# first, remove them Qubes-way
|
||||||
if os.path.exists(xmlpath):
|
if os.path.exists(xmlpath):
|
||||||
|
try:
|
||||||
cls.remove_vms(vm for vm in qubes.Qubes(xmlpath).domains
|
cls.remove_vms(vm for vm in qubes.Qubes(xmlpath).domains
|
||||||
if vm.name.startswith(prefix))
|
if vm.name.startswith(prefix))
|
||||||
|
except qubes.exc.QubesException:
|
||||||
|
# If qubes-test.xml is broken that much it doesn't even load,
|
||||||
|
# simply remove it. VMs will be cleaned up the hard way.
|
||||||
|
# TODO logging?
|
||||||
|
pass
|
||||||
os.unlink(xmlpath)
|
os.unlink(xmlpath)
|
||||||
|
|
||||||
# now remove what was only in libvirt
|
# now remove what was only in libvirt
|
||||||
|
Loading…
Reference in New Issue
Block a user