RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2086141 - Update python38-jinja2 to 2.11.x
Summary: Update python38-jinja2 to 2.11.x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: python-jinja2
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Charalampos Stratakis
QA Contact: Lukáš Zachar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-14 04:17 UTC by Maxwell G
Modified: 2022-11-08 10:41 UTC (History)
5 users (show)

Fixed In Version: python38-3.8-8070020220607122956.bd194b04 python-jinja2-2.11.3-1.module+el8.7.0+15575+d005caff
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:44:15 UTC
Type: Component Upgrade
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
[PATCH] Update to 2.11.3. Fixes rhbz#2086141. (7.34 KB, patch)
2022-05-22 04:31 UTC, Maxwell G
no flags Details | Diff
Reproducer playbook (566 bytes, text/plain)
2022-05-24 02:35 UTC, Maxwell G
no flags Details
[PATCH] Backport missing jinja2 tests needed by ansible-core (rhbz#2086141). (9.81 KB, patch)
2022-05-25 01:50 UTC, Maxwell G
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-122035 0 None None None 2022-05-14 04:30:21 UTC
Red Hat Product Errata RHSA-2022:7581 0 None None None 2022-11-08 09:44:24 UTC

Description Maxwell G 2022-05-14 04:17:11 UTC
Description of problem:

Please update python3-jinja2 and python38-jinja2 to at least 2.11.x.

Comment 1 Maxwell G 2022-05-14 04:24:13 UTC
I am not sure if I did something wrong, but it appears nobody was added to the CC list.

Comment 3 Tomas Orsava 2022-05-18 12:12:48 UTC
Hi Maxwell,
what's the use case you need these updates for?

And if you'd like us to prioritize this properly, consider filing a customer case for this request.

Comment 4 Maxwell G 2022-05-18 16:14:31 UTC
Hi Tomas,

(In reply to Tomas Orsava from comment #3)
> what's the use case you need these updates for?

There is certain functionality in ansible-core that does not work without a newer version of jinja2. Only the python38 version really needs to be updated for my usecase. I suppose ansible 2.9 which is still in the Ansible Engine channel could also make use of the python36 version.

Comment 5 Maxwell G 2022-05-22 04:31:39 UTC
Created attachment 1881999 [details]
[PATCH] Update to 2.11.3. Fixes rhbz#2086141.

I wrote this patch against the c8s-stream-3.8 branch[1]. It can be applied to RHEL dist-git with "git am -p2". FWIW, this is the same version that's currently in c9s. I have confirmed that it fixes my issue.

[1]: https://git.centos.org/rpms/python-jinja2/tree/c8s-stream-3.8

Comment 6 Tomas Orsava 2022-05-23 09:28:08 UTC
Interesting, and thanks for the patch. Can you expand on what ansible-core functionality does not work without a newer version of jinja2?

Comment 7 Maxwell G 2022-05-24 02:35:36 UTC
Created attachment 1882537 [details]
Reproducer playbook

I have attached a (slightly contrived) reproducer Ansible playbook. These type of assert tasks are more commonly used to verify user modifiable variables in a role. Basically, the problem comes down to the missing boolean, integer, and float jinja2 tests.

With ansible-core and python38-jinja2-2.10.3-5.module+el8.5.0+10542+ba057329.noarch on RHEL 8:

```
$ ./missing_jinja_tests.yml

PLAY [missing_jinja_tests] *****************************************************************************************

TASK [ansible.builtin.assert] **************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'test_boolean is boolean' failed. The error was: template error while templating string: no test named 'boolean'. String: {% if test_boolean is boolean %} True {% else %} False {% endif %}"}
...ignoring

TASK [ansible.builtin.assert] **************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'test_int is integer' failed. The error was: template error while templating string: no test named 'integer'. String: {% if test_int is integer %} True {% else %} False {% endif %}"}
...ignoring

TASK [ansible.builtin.assert] **************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check 'test_float is float' failed. The error was: template error while templating string: no test named 'float'. String: {% if test_float is float %} True {% else %} False {% endif %}"}
...ignoring

PLAY RECAP *********************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=3
```

With ansible-core and `python38-jinja2-2.11.3-1.el8.noarch` (my patch built against python38 with `--define "python3_pkgversion 38"`):

```
PLAY [missing_jinja_tests] *****************************************************************************************

TASK [ansible.builtin.assert] **************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [ansible.builtin.assert] **************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

TASK [ansible.builtin.assert] **************************************************************************************
ok: [localhost] => {
    "changed": false,
    "msg": "All assertions passed"
}

PLAY RECAP *********************************************************************************************************
localhost                  : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```

Comment 8 Miro Hrončok 2022-05-24 09:58:22 UTC
So, technically, backporting https://github.com/pallets/jinja/pull/824 would fix this for you?

Comment 9 Maxwell G 2022-05-24 14:36:49 UTC
(In reply to Miro Hrončok from comment #8)
> So, technically, backporting https://github.com/pallets/jinja/pull/824 would
> fix this for you?

Yes, that should work. I forgot that was an option.

Comment 10 Maxwell G 2022-05-25 01:50:25 UTC
Created attachment 1883003 [details]
[PATCH] Backport missing jinja2 tests needed by ansible-core (rhbz#2086141).

A complete update would be preferable, but I suppose just backporting the missing tests would suffice if the former is not unpermissible. I have confirmed that this patch also fixes my issue.

Comment 11 Maxwell G 2022-05-25 02:01:06 UTC
> not unpermissible
s/not unpermissible/unpermissible/

Comment 12 Tomas Orsava 2022-06-01 12:25:06 UTC
We can rebase python38-jinja2 as it's in a module and there the rebase policy is less strict. For python3-jinja2 we would only consider a backport, but since the reporter explicitly says a fix for python3-jinja2 is not needed for their use case hence we won't be backporting the fix at this point. We'll do a rebase of the python38-jinja2.

Comment 13 Maxwell G 2022-06-01 14:10:30 UTC
Thank you, Tomas! I've changed the Bugzilla summary accordingly.

Comment 19 errata-xmlrpc 2022-11-08 09:44:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: python38:3.8 and python38-devel:3.8 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:7581


Note You need to log in before you can comment on or make changes to this bug.