Skip to content

Commit

Permalink
Avoid false error caused by TypeError with jinja rule (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Sep 27, 2023
1 parent 76e1417 commit 53421b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/playbooks/rule-jinja-pass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
- name: Bug https://github.com/ansible/ansible-lint/issues/3048
ansible.builtin.set_fact:
x: "{{ y.json | community.general.json_query(edition.version) }}"
- name: Bug https://github.com/ansible/ansible-lint/issues/3769
ansible.builtin.debug:
msg: "{{ 65534 | ansible.builtin.random(seed=inventory_hostname) }}"

# https://github.com/ansible/ansible-lint/issues/2697
- name: Test linter
Expand Down
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def matchtask(
)
if ignored_re.search(orig_exc_message) or isinstance(
orig_exc,
AnsibleParserError,
(AnsibleParserError, TypeError),
):
# An unhandled exception occurred while running the lookup plugin 'template'. Error was a <class 'ansible.errors.AnsibleError'>, original message: the template file ... could not be found for the lookup. the template file ... could not be found for the lookup

Expand Down

0 comments on commit 53421b2

Please sign in to comment.