mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Attempt 4: Prevent reparenting a block with itself (#38747)
* More concisely reparent, ensuring we don't go too shallow or too deep in this process. Fixes #38357 * More explicit reparenting, with a short circuit for a common case * We need new_block to have a parent, otherwise we lose context with this approach * Remove duplicate parent assignment * Change callers of Block.copy to not use exclude_parent=True, when including the parent, exclude tasks
This commit is contained in:
parent
d2ce1d3c26
commit
f474195a3b
3 changed files with 18 additions and 21 deletions
|
@ -410,9 +410,7 @@ class Role(Base, Become, Conditional, Taggable):
|
|||
block_list.extend(dep_blocks)
|
||||
|
||||
for idx, task_block in enumerate(self._task_blocks):
|
||||
new_task_block = task_block.copy(exclude_parent=True)
|
||||
if task_block._parent:
|
||||
new_task_block._parent = task_block._parent.copy()
|
||||
new_task_block = task_block.copy()
|
||||
new_task_block._dep_chain = new_dep_chain
|
||||
new_task_block._play = play
|
||||
if idx == len(self._task_blocks) - 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue