From efa2b2d858fc16f228308c157eedb3c1d819430c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 12 Jul 2018 21:22:15 +0200 Subject: [PATCH] Remove templates from listing in UpdateVM and ClockVm in Global Settings A user should not be able to set a TemplateVM as an UpdateVM or ClockVM in Global Settings. fixes QubesOS/qubes-issues#1831 --- qubesmanager/global_settings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubesmanager/global_settings.py b/qubesmanager/global_settings.py index cec533c..23779e0 100644 --- a/qubesmanager/global_settings.py +++ b/qubesmanager/global_settings.py @@ -63,13 +63,15 @@ class GlobalSettingsWindow(ui_globalsettingsdlg.Ui_GlobalSettings, # set up updatevm choice self.update_vm_vmlist, self.update_vm_idx = utils.prepare_vm_choice( self.update_vm_combo, self.qvm_collection, 'updatevm', - None, allow_none=True + None, allow_none=True, + filter_function=(lambda vm: vm.klass != 'TemplateVM') ) # set up clockvm choice self.clock_vm_vmlist, self.clock_vm_idx = utils.prepare_vm_choice( self.clock_vm_combo, self.qvm_collection, 'clockvm', - None, allow_none=True + None, allow_none=True, + filter_function=(lambda vm: vm.klass != 'TemplateVM') ) # set up default netvm