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

Prevent KeyError[0] exception with ansible.builtin.include_tasks #1935

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ansiblelint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,11 @@ def _include_children(
basedir: str, k: str, v: Any, parent_type: FileType
) -> List[Lintable]:
# handle special case include_tasks: name=filename.yml
if k == "include_tasks" and isinstance(v, dict) and "file" in v:
if (
k in ["include_tasks", "ansible.builtin.include_tasks"]
and isinstance(v, dict)
and "file" in v
):
v = v["file"]

# handle include: filename.yml tags=blah
Expand Down