Skip to content

Commit

Permalink
Prevent KeyError[0] exception with ansible.builtin.include_tasks (#1935)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Feb 18, 2022
1 parent 6516fc9 commit 1c2f69d
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit 1c2f69d

Please sign in to comment.