Skip to content
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

Newer version of jinja2 breaks the role #125

Open
layereight opened this issue Jun 1, 2022 · 3 comments
Open

Newer version of jinja2 breaks the role #125

layereight opened this issue Jun 1, 2022 · 3 comments

Comments

@layereight
Copy link
Contributor

layereight commented Jun 1, 2022

tested with:

  • latest role version 1.13.1
  • python 3.10
  • jinja2 3.1.2
  • will fail with:
TASK [MichaelRigart.interfaces : Check active Ethernet interface state] ************
[WARNING]: Skipping plugin (/home/stefan/private/ansible-
homecenter/roles/MichaelRigart.interfaces/filter_plugins/filters.py) as it seems to
be invalid: module 'jinja2' has no attribute 'contextfilter'
fatal: [homecenter]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ item | ether_check }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: No filter named 'ether_check'.. String: {{ item | ether_check }}"}

tested workaround:

  • going back to jinja 3.0.3 fixes the problem

I haven't checked which jinja2 version update really introduces the breaking change...

@YuxingW
Copy link

YuxingW commented Jun 24, 2022

contextfilter is deprecated in jinja2 and can be replaced by pass_context
jupyter/nbconvert#1568

@YuxingW
Copy link

YuxingW commented Jun 28, 2022

We have checked in a fix for this issue in the latest code.

@layereight
Copy link
Contributor Author

Cool! Will check on the next occasion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants