Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KeyError on key-order rule with blocks #4116

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

Qalthos
Copy link
Contributor

@Qalthos Qalthos commented Apr 18, 2024

Fixes #4091

_get_path_to_task_in_nested_tasks_block() seems to do the wrong thing under certain circumstances when lineno > next_task_line_index. It seems like we should never want that anyway, so just skip the whole thing until there is not a later play that is earlier than lineno.

`_get_path_to_task_in_nested_tasks_block()` seems to do the wrong thing
under certain circumstances when lineno > next_task_ling_index. It seems
like we should never want that anyway, so just skip the whole thing
until there is not a later play that is earlier than lineno.
@Qalthos Qalthos requested a review from a team as a code owner April 18, 2024 16:23
@Qalthos Qalthos requested review from ssbarnea and priyamsahoo and removed request for a team April 18, 2024 16:23
@Qalthos Qalthos added the bug label Apr 18, 2024
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test.

@Qalthos Qalthos requested a review from ssbarnea April 22, 2024 16:04
@audgirka audgirka merged commit d5bb93a into ansible:main Apr 23, 2024
23 checks passed
@Qalthos Qalthos deleted the block-keyerror branch April 23, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

KeyError when fixing playbook containing multiple blocks with wrong key order
3 participants