From b19d9e1373c5e894473eea21502f9b0d8e8b05f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Mon, 29 Jul 2019 21:52:40 +0200 Subject: [PATCH] Changed checking for VM name in use In near future the old way will stop working, so this is a pre-emptive fix. --- qubesmanager/create_new_vm.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/qubesmanager/create_new_vm.py b/qubesmanager/create_new_vm.py index 0c82fb8..cb89120 100644 --- a/qubesmanager/create_new_vm.py +++ b/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 {} already exists in the ' 'system!').format(name))