utils: include management_dispvm property when checking where VM is used

Fixes QubesOS/qubes-issues#4812
This commit is contained in:
Marek Marczykowski-Górecki 2019-02-18 23:09:31 +01:00
parent bde60c154a
commit 2ad9b57961
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 7 additions and 4 deletions

View File

@ -36,7 +36,8 @@ class TestVMUsage(qubesadmin.tests.QubesTestCase):
b'sys-firewall class=AppVM state=Running\n' b'sys-firewall class=AppVM state=Running\n'
self.global_properties = ['default_dispvm', 'default_netvm', self.global_properties = ['default_dispvm', 'default_netvm',
'default_template', 'clockvm', 'updatevm'] 'default_template', 'clockvm', 'updatevm',
'management_dispvm']
for prop in self.global_properties: for prop in self.global_properties:
self.app.expected_calls[ self.app.expected_calls[
@ -45,7 +46,8 @@ class TestVMUsage(qubesadmin.tests.QubesTestCase):
self.vms = ['vm1', 'vm2', 'sys-net', 'sys-firewall', self.vms = ['vm1', 'vm2', 'sys-net', 'sys-firewall',
'template1', 'template2'] 'template1', 'template2']
self.vm_properties = ['template', 'netvm', 'default_dispvm'] self.vm_properties = ['template', 'netvm', 'default_dispvm',
'management_dispvm']
for vm in self.vms: for vm in self.vms:
for prop in self.vm_properties: for prop in self.vm_properties:

View File

@ -126,13 +126,14 @@ def vm_dependencies(app, reference_vm):
result = [] result = []
global_properties = ['default_dispvm', 'default_netvm', global_properties = ['default_dispvm', 'default_netvm',
'default_template', 'clockvm', 'updatevm'] 'default_template', 'clockvm', 'updatevm',
'management_dispvm']
for prop in global_properties: for prop in global_properties:
if reference_vm == getattr(app, prop, None): if reference_vm == getattr(app, prop, None):
result.append((None, prop)) result.append((None, prop))
vm_properties = ['template', 'netvm', 'default_dispvm'] vm_properties = ['template', 'netvm', 'default_dispvm', 'management_dispvm']
for vm in app.domains: for vm in app.domains:
for prop in vm_properties: for prop in vm_properties: