Template "original_task" fields in _process_pending_results

Since we no longer use a post-validated task in _process_pending_results, we
need to be sure to template fields used in original_task as they are raw and
may contain variables.

This patch also moves the handler tracking to be per-uuid, not per-object.
Doing it per-object had implications for the above due to the fact that the
copy of the original task is now being used, so the only sure way is to track
based on the uuid instead.

Fixes #18289
This commit is contained in:
James Cammarata 2016-12-20 08:43:39 -06:00
commit dd0257b995
3 changed files with 70 additions and 52 deletions

View file

@ -138,8 +138,8 @@ class TaskQueueManager:
# then initialize it with the given handler list
for handler in handler_list:
if handler not in self._notified_handlers:
self._notified_handlers[handler] = []
if handler._uuid not in self._notified_handlers:
self._notified_handlers[handler._uuid] = []
if handler.listen:
listeners = handler.listen
if not isinstance(listeners, list):
@ -147,14 +147,7 @@ class TaskQueueManager:
for listener in listeners:
if listener not in self._listening_handlers:
self._listening_handlers[listener] = []
# if the handler has a name, we append it to the list of listening
# handlers, otherwise we use the uuid to avoid trampling on other
# nameless listeners
if handler.name:
self._listening_handlers[listener].append(handler.get_name())
else:
self._listening_handlers[listener].append(handler._uuid)
self._listening_handlers[listener].append(handler._uuid)
def load_callbacks(self):
'''