浏览代码

Changed checking for VM name in use

In near future the old way will stop working, so
this is a pre-emptive fix.
Marta Marczykowska-Górecka 4 年之前
父节点
当前提交
b19d9e1373
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      qubesmanager/create_new_vm.py

+ 4 - 6
qubesmanager/create_new_vm.py

@@ -135,12 +135,10 @@ class NewVmDlg(QtGui.QDialog, Ui_NewVMDlg):
                    else 'StandaloneVM')
 
         name = str(self.name.text())
-        try:
-            self.app.domains[name]
-        except LookupError:
-            pass
-        else:
-            QtGui.QMessageBox.warning(None,
+
+        if name in self.app.domains:
+            QtGui.QMessageBox.warning(
+                None,
                 self.tr('Incorrect qube name!'),
                 self.tr('A qube with the name <b>{}</b> already exists in the '
                         'system!').format(name))