-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Feature: Use Jinja's new NativeEnvironment to get native types instead of strings! #3828
Comments
Thanks for letting us know about this. It seems like a great overall feature which would help in a lot of scenarios. Having said that, the change will probably be quite big and we also need to research it to make sure it's actually a good for our use case (need to make sure it works across Python versions and not like pickle, need to research safety of this feature, etc). Also, #2976 is not related to Jinja, but to the way we store and serialize values in the datastore. |
https://pypi.python.org/pypi/Jinja2/2.10 |
#3820 might also be related and/or fixed using this feature |
And here's how simple it is for Ansible to switch over to using NativeEnvironment: |
That effort could be related to (or perhaps made easier with) this feature. |
This is a major-ish change - Maybe this can go in 3.0? Or make its way onto the roadmap? (Please) |
think this is what's implemented and merged in #32738, looks like it was relased in ansible v2.5 |
It's really hard to deal with magically converting from Jinja strings back into native python types. Let's just skip the conversion and use native python types.
How you ask? Jinja has merged a pretty cool PR: pallets/jinja#708
Here's a quote from the new doc:
This consists of three basic parts:
NativeCodeGenerator
,NativeTemplate
, andNativeEnvironment
. Check out the code. This will land in Jinja 2.10.This comes from an ansible PR by @jctanner: ansible/ansible#23943
I suspect that using
NativeEnvironment
would resolve (or make a big dent in) these:The text was updated successfully, but these errors were encountered: