-
Notifications
You must be signed in to change notification settings - Fork 28
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
Replacing selectattr('tls', 'true'|'false') with selectattr('tls', '==', true|false) #169
Conversation
I am afraid that this will not work in older Jinja2: linux-system-roles/storage#49 |
(;_;) Thanks for your input, @pcahyna. Replacing 'eq' with '=='. |
@nhosoi please verify that it actually works with Jinja 2.7, you can use RHEL 7 or CentOS 7 as a control host for that |
I don't think it works there either. In fact, I think there is a lot of code that won't work with jinja2 2.7. I think One easy way to test is with a venv:
|
Thanks, @richm. Confirmed
Sadly, replacing Logging role is the one that uses selectattr most (not just in this PR, but it's been in the code for a long time...). Should we replace it with something backward compatible??? But I think @richm is right. There should be more cases which do not work with
|
BTW, I'm wondering why this molecule failure has started. I can reproduce it with "tox -e molecule". Again, this is likely a version issue since if I run "tox -e molecule" with
|
@nhosoi, concerning the last problem: @i386x said in chat: ansible-lint issue is fixed in upstream now: ansible/ansible-lint@5b5c000 |
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.
Ready to merge? This will solve compatibility with Jinja 2.10 and 2.7 will have to be solved later.
one more comment: |
If that's the case, we could close this pr and live with selectattr('tls', 'true'|'false'), right? If ok with you, closing this. |
No, we need to support 2.10, the true/false tests were added in 2.11. Or have you verified that the true/false tests work in RHEL 8? |
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.
true
and false
should be lowercase
…=', true|false). In the jinja2 doc: true(value) and false(value) are "New in version 2.11."
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.
lgtm
Thank you, @richm. Merged! |
Note: In the jinja2 doc:
true(value) and false(value) are "New in version 2.11."
Plus,
eq
is not supported in Jinja 2.7.2.