Fix handler listeners as a list

The listen statement on handlers should have supported a list, however
it was broken in the revision of the pub/sub feature based on the handler
revamp. This patch corrects the bug, so this works again:

- name: some handler
  ...
  listen:
  - some target
  - another target

Fixes #16378
pull/16381/head
James Cammarata 9 years ago
parent b7f9037b5b
commit 15e648dd94

@ -149,9 +149,13 @@ class TaskQueueManager:
if handler not in self._notified_handlers: if handler not in self._notified_handlers:
self._notified_handlers[handler] = [] self._notified_handlers[handler] = []
if handler.listen: if handler.listen:
if handler.listen not in self._listening_handlers: listeners = handler.listen
self._listening_handlers[handler.listen] = [] if not isinstance(listeners, list):
self._listening_handlers[handler.listen].append(handler.get_name()) listeners = [ listeners ]
for listener in listeners:
if listener not in self._listening_handlers:
self._listening_handlers[listener] = []
self._listening_handlers[listener].append(handler.get_name())
def load_callbacks(self): def load_callbacks(self):
''' '''

Loading…
Cancel
Save