Remove deprecated UnsafeProxy (#77455)

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

@ -0,0 +1,2 @@
removed_features:
- Remove deprecated ``UnsafeProxy``

@ -84,25 +84,6 @@ class NativeJinjaUnsafeText(NativeJinjaText, AnsibleUnsafeText):
pass pass
class UnsafeProxy(object):
def __new__(cls, obj, *args, **kwargs):
from ansible.utils.display import Display
Display().deprecated(
'UnsafeProxy is being deprecated. Use wrap_var or AnsibleUnsafeBytes/AnsibleUnsafeText directly instead',
version='2.13', collection_name='ansible.builtin'
)
# In our usage we should only receive unicode strings.
# This conditional and conversion exists to sanity check the values
# we're given but we may want to take it out for testing and sanitize
# our input instead.
if isinstance(obj, AnsibleUnsafe):
return obj
if isinstance(obj, string_types):
obj = AnsibleUnsafeText(to_text(obj, errors='surrogate_or_strict'))
return obj
def _wrap_dict(v): def _wrap_dict(v):
return dict((wrap_var(k), wrap_var(item)) for k, item in v.items()) return dict((wrap_var(k), wrap_var(item)) for k, item in v.items())

Loading…
Cancel
Save