From 0a06ad91524d678b085fefca04ca8ef684497348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 20 Sep 2017 20:19:38 +0200 Subject: [PATCH] events: ignore events from non-existing domains It may happen that when client handle the event, domain no longer exists. This is for example common for DispVMs, which get removed just after shutdown. This will cause some events to be dropped, but one can enable blind mode, to get them anyway (because it will not cause KeyError, even if domain is already removed). QubesOS/qubes-issues#3100 --- qubesadmin/events/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qubesadmin/events/__init__.py b/qubesadmin/events/__init__.py index 70b554f..86ce94b 100644 --- a/qubesadmin/events/__init__.py +++ b/qubesadmin/events/__init__.py @@ -191,7 +191,10 @@ class EventsDispatcher(object): if subject: if event in ['property-set:name']: self.app.domains.clear_cache() - subject = self.app.domains[subject] + try: + subject = self.app.domains[subject] + except KeyError: + return else: # handle cache refreshing on best-effort basis if event in ['domain-add', 'domain-delete']: