tests/backup: fix handling different VM types

Not all VM types have 'template' property.
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-17 00:49:53 +02:00
parent 460f0849a7
commit dd93650ea7
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -55,6 +55,8 @@ class TC_00_Backup(qubes.tests.BackupTestsMixin, qubes.tests.QubesTestCase):
"VM {} - property {} not properly restored".format(
vm.name, prop))
for prop in ('netvm', 'template', 'label'):
if not hasattr(vm, prop):
continue
orig_value = getattr(vm, prop)
restored_value = getattr(restored_vm, prop)
if orig_value and restored_value: