forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not ignore SyntaxError from jinja2.Environment.from_string (ansibl…
…e#82607) Jinja may generate an invalid Python source code from a template. Trying to compile such source code into a Python code object results in SyntaxError being thrown. An example of such a template is providing the same keyword argument into a lookup twice, resulting in: `SyntaxError: keyword argument repeated`. Since `jinja2.exceptions.TemplateSyntaxError` does not cover such a case, as it is not a Jinja parsing error, we need to catch SyntaxError explicitly ourselves. Fixes ansible#82606 (cherry picked from commit 6d34eb8)
- Loading branch information
Showing
3 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- templating - ensure syntax errors originating from a template being compiled into Python code object result in a failure (https://github.com/ansible/ansible/issues/82606) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters