Ensure correct environment_class is set on Template (#77485) (#77488)

(cherry picked from commit c7e198b907)
pull/77500/head
Martin Krizek 3 years ago committed by GitHub
parent 30f96bb75e
commit bd1da60bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- Ensure the correct ``environment_class`` is set on ``AnsibleJ2Template``

@ -674,6 +674,7 @@ class Templar:
extensions=self._get_extensions(),
loader=FileSystemLoader(loader.get_basedir() if loader else '.'),
)
self.environment.template_class.environment_class = environment_class
# jinja2 global is inconsistent across versions, this normalizes them
self.environment.globals['dict'] = dict

Loading…
Cancel
Save