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.
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-24 23:14:49 +02:00
parent b25cf4b085
commit 354aa14c53
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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