mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Correctly compile handler blocks for dependent roles
This commit is contained in:
@@ -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):
|
||||
'''
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user