Remove finalize from globals (#76439)

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

@ -0,0 +1,2 @@
breaking_changes:
- "The ``finalize`` method is no longer exposed in the globals for use in templating."

@ -33,6 +33,8 @@ Playbook
* The return value of the ``__repr__`` method of an undefined variable represented by the ``AnsibleUndefined`` object changed. ``{{ '%r'|format(undefined_variable) }}`` returns ``AnsibleUndefined(hint=None, obj=missing, name='undefined_variable')`` in 2.13 as opposed to just ``AnsibleUndefined`` in versions 2.12 and prior.
* The ``finalize`` method is no longer exposed in the globals for use in templating. To convert ``None`` to an empty string the following expression can be used: ``{{ value if value is not none }}``.
Command Line
============

@ -650,7 +650,6 @@ class Templar:
self.environment.globals['lookup'] = self._lookup
self.environment.globals['query'] = self.environment.globals['q'] = self._query_lookup
self.environment.globals['now'] = self._now_datetime
self.environment.globals['finalize'] = self._finalize
self.environment.globals['undef'] = self._make_undefined
# the current rendering context under which the templar class is working

Loading…
Cancel
Save