tests: be even more defensive on cleaning up VMs

Don't fail even if qubes-test.xml do not load at all because of syntax
error - for example empty file.
This commit is contained in:
Marek Marczykowski-Górecki 2017-02-23 03:07:57 +01:00
parent c5a8135fdb
commit a6c7da6061
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -700,7 +700,7 @@ class SystemTestsMixin(object):
try:
cls.remove_vms(vm for vm in qubes.Qubes(xmlpath).domains
if vm.name.startswith(prefix))
except qubes.exc.QubesException:
except (qubes.exc.QubesException, lxml.etree.XMLSyntaxError):
# 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?