Avoid spurious warnings when setting NetVM

Qube Manager currently shows a security warning when changing the NetVM of TemplateVMs.
This warning is generally useful, but not when disabling networking;
for example changing the NetVM from from "default" to "none".

In this chnage I suppress the warning when the NetVM for a TemplateVM is changed to "none".
This commit is contained in:
Saswat Padhi 2021-05-10 20:23:57 +00:00
parent 1afd46da6b
commit bf37bb366e
No known key found for this signature in database
GPG Key ID: F8B6E3245A18068C

View File

@ -627,7 +627,14 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
self.warn_too_much_mem_label.setVisible(True) self.warn_too_much_mem_label.setVisible(True)
def check_warn_templatenetvm(self): def check_warn_templatenetvm(self):
if self.vm.klass == 'TemplateVM': if self.vm.klass != 'TemplateVM':
return
current_netvm = self.netVM.currentData()
if current_netvm is None:
return
if current_netvm != qubesadmin.DEFAULT:
QtWidgets.QMessageBox.warning( QtWidgets.QMessageBox.warning(
self, self,
self.tr("Warning!"), self.tr("Warning!"),