Correctly compile handler blocks for dependent roles

This commit is contained in:
James Cammarata 2015-06-23 15:48:48 -04:00
parent 0b16580567
commit d0d9be30d5
2 changed files with 6 additions and 5 deletions

View file

@ -288,7 +288,12 @@ class Role(Base, Become, Conditional, Taggable):
return self._task_blocks[:]
def get_handler_blocks(self):
return self._handler_blocks[:]
block_list = []
for dep in self.get_direct_dependencies():
dep_blocks = dep.get_handler_blocks()
block_list.extend(dep_blocks)
block_list.extend(self._handler_blocks)
return block_list
def has_run(self):
'''

View file

@ -366,10 +366,6 @@ class StrategyBase:
result = True
# FIXME: getting the handlers from the iterators play should be
# a method on the iterator, which may also filter the list
# of handlers based on the notified list
for handler_block in iterator._play.handlers:
# FIXME: handlers need to support the rescue/always portions of blocks too,
# but this may take some work in the iterator and gets tricky when