Fixed error with VM being incorrectly listed as its own dependency

fixes QubesOS/qubes-issues#4224
This commit is contained in:
Marta Marczykowska-Górecka 2019-09-17 00:30:47 +02:00
parent 769f8a5ee8
commit 3e2b432644
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 3 additions and 1 deletions

View File

@ -76,7 +76,7 @@ class TestVMUsage(qubesadmin.tests.QubesTestCase):
set(result),
set([(vm, prop) for vm in self.vms for prop in self.vm_properties
if (not vm.startswith('template')
or not prop.startswith('template'))]),
or not prop.startswith('template')) and vm != 'template1']),
"Incorrect VM properties listed.")
def test_02_empty(self):

View File

@ -136,6 +136,8 @@ def vm_dependencies(app, reference_vm):
vm_properties = ['template', 'netvm', 'default_dispvm', 'management_dispvm']
for vm in app.domains:
if vm == reference_vm:
continue
for prop in vm_properties:
if reference_vm == getattr(vm, prop, None) and \
not vm.property_is_default(prop):