Ver código fonte

api/admin: don't send internal events in admin.Events

Some events are internal for a sole purpose of getting some data from
extension. Since listeners of admin.Events cannot return anything, there
is no sense in sending those events there.
Marek Marczykowski-Górecki 6 anos atrás
pai
commit
354aa14c53
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      qubes/api/admin.py

+ 10 - 0
qubes/api/admin.py

@@ -43,8 +43,18 @@ class QubesMgmtEventsDispatcher(object):
         self.send_event = send_event
 
     def vm_handler(self, subject, event, **kwargs):
+        # do not send internal events
         if event.startswith('admin-permission:'):
             return
+        if event.startswith('device-get:'):
+            return
+        if event.startswith('device-list:'):
+            return
+        if event.startswith('device-list-attached:'):
+            return
+        if event in ('domain-is-fully-usable',):
+            return
+
         if not list(qubes.api.apply_filters([(subject, event, kwargs)],
                 self.filters)):
             return