mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
* add tests for fail filter
also tests that fail does not block inspectability
* add fail filter
fallback message is a bit clunky,
since you can't invoke a filter without specifying an input.
That is, "{{ fail }}" doesn't work,
so you have to do "{{ None | fail }}"
* document 'fail' filter
* add changelog fragment
* fail filter uses default message on Undefined or emptystring
makes it slightly easier to use the default message:
```diff
- "{{ None | fail }}"
+ "{{ '' | fail }}"
```
and the user sees a slightly more relevant message
if the message itself is undefined:
```diff
- The error was: {{ failmsg | fail }}: 'failmsg' is undefined
+ The error was: {{ failmsg | fail }}: Mandatory variable has not been overridden
```
* rebuild as the builtin `Undefined`
* harmonise `hint` parameter for make_undefined with jinja
* use code block for documentation item
[ref](https://github.com/ansible/ansible/pull/75435#discussion_r707661035)
* rename to `undef` to expose less Python into the Jinja
[ref](https://github.com/ansible/ansible/pull/75435#pullrequestreview-757799031)
* explicitly instantiate undefined value now that it's possible
see I knew we would break something with reflection
* preserve test coverage of undefined variable
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
|
4 years ago | |
|---|---|---|
| .. | ||
| _vendor | 5 years ago | |
| ansible_test | 5 years ago | |
| cli | 5 years ago | |
| compat | 7 years ago | |
| config | 5 years ago | |
| errors | 5 years ago | |
| executor | 4 years ago | |
| galaxy | 4 years ago | |
| inventory | 6 years ago | |
| inventory_test_data/group_vars | 11 years ago | |
| mock | 4 years ago | |
| module_utils | 4 years ago | |
| modules | 4 years ago | |
| parsing | 4 years ago | |
| playbook | 5 years ago | |
| plugins | 4 years ago | |
| regex | 7 years ago | |
| template | 4 years ago | |
| utils | 5 years ago | |
| vars | 6 years ago | |
| __init__.py | 9 years ago | |
| requirements.txt | 5 years ago | |
| test_constants.py | 6 years ago | |
| test_context.py | 6 years ago | |