Merge remote-tracking branch 'origin/pr/105'

* origin/pr/105:
  Fixed error with VM being incorrectly listed as its own dependency
This commit is contained in:
Marek Marczykowski-Górecki 2019-09-21 03:34:31 +02:00
commit 22bc5d880a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
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):