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
Do not crash templating when filter/test name is not a valid Ansible plugin name #78913
Do not crash templating when filter/test name is not a valid Ansible plugin name #78913
Conversation
07286a5
to
94556fd
Compare
Ok, this doesn't really work, since |
I think there are just a couple places that filters/tests need to be special-cased for import/load failures. I think this would fix some test failures: c0629b9 Otherwise, we could also pass the delegatee plugins to the plugin loader, so then we wouldn't need to differentiate between missing/broken plugins outside of the loader. But I like your current approach. Or we could save the initial KeyError and reraise with the original exception if there is no delegatee. |
code is good start, I agree with @s-hertel on saving the keyerror in case the plugin is also not found in the JInaj2 provided ones. |
@s-hertel thanks, that indeed fixes the CI failures! |
/rebuild_failed |
…plugin name (ansible#78913) * Do not crash templating when filter/test name is not a valid Ansible plugin name. * Store and re-raise KeyError if there was one. Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com> (cherry picked from commit 6d0aeac)
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions.
* Ensure we detect templating errors As ansible/ansible#78913 changed behavior of Ansible on missing filters, we adapted the check so it would continue to work with newer versions. * chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
SUMMARY
Fixes #78912.
ISSUE TYPE
COMPONENT NAME
lib/ansible/template/__init__.py