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
jinja 2.10 compat: add missing built-in tests #64342
Conversation
The test
|
Would be nice to have that. I had to add a local test plugin for some integration tests to get them working with RHEL7 (like https://github.com/ansible/ansible/blob/devel/test/integration/targets/openssl_csr_info/test_plugins/jinja_compatibility.py). |
e003f1e
to
9a5c47a
Compare
Per discussion in the IRC meeting today, please add a test that only uses this if the Jinja version is missing these tests. |
e6de9b4
to
0423905
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add integration tests.
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) 2017, the Jinja Team | ||
# BSD 3-Clause "New" or "Revised" License (see https://opensource.org/licenses/BSD-3-Clause) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is compatible with the GPLv3 we use in Ansible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jijna itself is licensed with BSD 3-Clause (new BSD?) [0].
[0]: https://github.com/pallets/jinja/blob/master/LICENSE.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is compatible with the GPLv3 we use in Ansible
Looked it up: https://en.m.wikipedia.org/wiki/License_compatibility#GPL_compatibility
Many of the most common free-software licenses, especially the permissive licenses, such as the original MIT/X license, BSD licenses (in the three-clause and two-clause forms, though not the original four-clause form), MPL 2.0, and LGPL, are GPL-compatible.
Hence, I can apply the GPLv3 label of it helps get it merged.
The test
|
this allows us to use the jinja versions if they are available
Co-authored-by: Sam Doran <sdoran@redhat.com>
85f6a68
to
7cdfe6a
Compare
bot_status |
Componentschangelogs/fragments/compat-jinja-2.10-test.yml lib/ansible/plugins/test/compat_jinja_2_10.py lib/ansible/plugins/test/compat_jinja_2_11.py test/integration/targets/test_core/tasks/main.yml Metadatawaiting_on: jamescassell |
Rather than adding these directly to Ansible, use the sivel.jinja2 collection. After the 2.10 release, we will look at making that an officially supported collection. This would allow us to update the Jinja filters and tests much faster than if we add this directly to To discuss this further, please reach out on IRC or the mailing list: * IRC: #ansible-devel on irc.freenode.net |
SUMMARY
fixed ansible template failures on older jinja due to missing built-in tests
ISSUE TYPE
COMPONENT NAME
jinja tests
ADDITIONAL INFORMATION
Playbooks and roles written on ansible 2.8 on a modern would fail if run with ansible 2.8 on RHEL 7 due to missing tests on that platform.
relevant jinja PR: pallets/jinja#665