From 161675cf6a65643ec7b33f38baca09b45e6d8b31 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Wed, 9 Mar 2011 15:26:27 +0100 Subject: [PATCH] Delete AppVM after failed create only if it was (partially) created. --- qubesmanager/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index e07a41b..864ca6e 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -570,6 +570,7 @@ class VmManagerWindow(QMainWindow): def do_create_appvm (self, vmname, label, template_vm, thread_monitor): + vm = None try: self.qvm_collection.lock_db_for_writing() self.qvm_collection.load() @@ -580,7 +581,8 @@ class VmManagerWindow(QMainWindow): self.qvm_collection.save() except Exception as ex: thread_monitor.set_error_msg (str(ex)) - vm.remove_from_disk() + if vm: + vm.remove_from_disk() finally: self.qvm_collection.unlock_db()