Browse Source

Merge remote-tracking branch 'origin/pr/291'

* origin/pr/291:
  mock QubesVMNotFoundError
  manager: Handle removal of VM during on_shutdown.
Marek Marczykowski-Górecki 2 years ago
parent
commit
340a28f108
2 changed files with 5 additions and 1 deletions
  1. 1 1
      qubesmanager/qube_manager.py
  2. 4 0
      test-packages/qubesadmin/exc.py

+ 1 - 1
qubesmanager/qube_manager.py

@@ -1059,7 +1059,7 @@ class VmManagerWindow(ui_qubemanager.Ui_VmManagerWindow, QMainWindow):
                             update(event="outdated")
             self.proxy.invalidate()
             self.table_selection_changed()
-        except exc.QubesDaemonAccessError:
+        except (exc.QubesDaemonAccessError, exc.QubesVMNotFoundError):
             return  # the VM was deleted before its status could be updated
         except KeyError:  # adding the VM failed for some reason
             self.on_domain_added(None, None, vm)

+ 4 - 0
test-packages/qubesadmin/exc.py

@@ -6,6 +6,10 @@ class QubesException(BaseException):
     pass
 
 
+class QubesVMNotFoundError(BaseException):
+    pass
+
+
 class QubesVMNotStartedError(BaseException):
     pass