Properly set finalize for the new environment (#76435)

* Properly set finalize for the new environment

Fixes #76379

* Fix sanity
pull/76478/head
Martin Krizek 3 years ago committed by GitHub
parent eca97a19a3
commit 4e7be293a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "``Templar.copy_with_new_env`` - set the ``finalize`` method of the new ``Templar`` object for the new environment (https://github.com/ansible/ansible/issues/76379)"

@ -698,6 +698,7 @@ class Templar:
new_templar = object.__new__(Templar)
new_templar.__dict__.update(self.__dict__)
new_templar.environment = new_env
new_templar.environment.finalize = new_templar._finalize
new_templar.jinja2_native = environment_class is AnsibleNativeEnvironment

Loading…
Cancel
Save