Browse Source

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".
Saswat Padhi 3 years ago
parent
commit
bf37bb366e
1 changed files with 8 additions and 1 deletions
  1. 8 1
      qubesmanager/settings.py

+ 8 - 1
qubesmanager/settings.py

@@ -627,7 +627,14 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
             self.warn_too_much_mem_label.setVisible(True)
 
     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(
                 self,
                 self.tr("Warning!"),