1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Make sure blocks use their parents dependency chains

Fixes a bug inroduced in fb797a9 where included tasks in a role
were not being executed because the child blocks had no dep chain
set.
This commit is contained in:
James Cammarata 2016-01-25 09:02:44 -05:00
parent 2b02e8e2b4
commit a8ffa02134

View file

@ -48,13 +48,17 @@ class Block(Base, Become, Conditional, Taggable):
self._parent_block = None self._parent_block = None
self._use_handlers = use_handlers self._use_handlers = use_handlers
self._implicit = implicit self._implicit = implicit
self._dep_chain = []
if task_include: if task_include:
self._task_include = task_include self._task_include = task_include
elif parent_block: elif parent_block:
self._parent_block = parent_block self._parent_block = parent_block
if parent_block:
self._dep_chain = parent_block._dep_chain[:]
else:
self._dep_chain = []
super(Block, self).__init__() super(Block, self).__init__()
def get_vars(self): def get_vars(self):
@ -374,3 +378,4 @@ class Block(Base, Become, Conditional, Taggable):
def has_tasks(self): def has_tasks(self):
return len(self.block) > 0 or len(self.rescue) > 0 or len(self.always) > 0 return len(self.block) > 0 or len(self.rescue) > 0 or len(self.always) > 0