From 2ad9b57961c4bb88a2e61e312e33d5b0cd0f7861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 18 Feb 2019 23:09:31 +0100 Subject: [PATCH] utils: include management_dispvm property when checking where VM is used Fixes QubesOS/qubes-issues#4812 --- qubesadmin/tests/utils.py | 6 ++++-- qubesadmin/utils.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/qubesadmin/tests/utils.py b/qubesadmin/tests/utils.py index 04833e2..b2fe962 100644 --- a/qubesadmin/tests/utils.py +++ b/qubesadmin/tests/utils.py @@ -36,7 +36,8 @@ class TestVMUsage(qubesadmin.tests.QubesTestCase): b'sys-firewall class=AppVM state=Running\n' self.global_properties = ['default_dispvm', 'default_netvm', - 'default_template', 'clockvm', 'updatevm'] + 'default_template', 'clockvm', 'updatevm', + 'management_dispvm'] for prop in self.global_properties: self.app.expected_calls[ @@ -45,7 +46,8 @@ class TestVMUsage(qubesadmin.tests.QubesTestCase): self.vms = ['vm1', 'vm2', 'sys-net', 'sys-firewall', 'template1', 'template2'] - self.vm_properties = ['template', 'netvm', 'default_dispvm'] + self.vm_properties = ['template', 'netvm', 'default_dispvm', + 'management_dispvm'] for vm in self.vms: for prop in self.vm_properties: diff --git a/qubesadmin/utils.py b/qubesadmin/utils.py index ccb3134..be5380a 100644 --- a/qubesadmin/utils.py +++ b/qubesadmin/utils.py @@ -126,13 +126,14 @@ def vm_dependencies(app, reference_vm): result = [] global_properties = ['default_dispvm', 'default_netvm', - 'default_template', 'clockvm', 'updatevm'] + 'default_template', 'clockvm', 'updatevm', + 'management_dispvm'] for prop in global_properties: if reference_vm == getattr(app, prop, None): result.append((None, prop)) - vm_properties = ['template', 'netvm', 'default_dispvm'] + vm_properties = ['template', 'netvm', 'default_dispvm', 'management_dispvm'] for vm in app.domains: for prop in vm_properties: