Prevent duplicately loaded handlers from running more than once.

Fixes #3863
pull/4396/head
Michael DeHaan 11 years ago
parent 5ed28efe45
commit f081c68a65

@ -538,10 +538,14 @@ class PlayBook(object):
# here a meta task is a placeholder that signals handlers should be run
if task.meta == 'flush_handlers':
fired_names = {}
for handler in play.handlers():
if len(handler.notified_by) > 0:
self.inventory.restrict_to(handler.notified_by)
self._run_task(play, handler, True)
if handler.name not in fired_names:
self._run_task(play, handler, True)
# prevent duplicate handler includes from running more than once
fired_names[handler.name] = 1
self.inventory.lift_restriction()
new_list = handler.notified_by[:]
for host in handler.notified_by:

Loading…
Cancel
Save