mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Don't check for var._obj in template._clean_data (#20868)
* Don't check for var._obj in template._clean_data AnsibleUnsafe or other unsafe vars used to have a '_obj' slot but no longer do. This was causing attribute errors if a object was 'unsafe' but not a string. Add tests for AnsibleUnsafe, lookups, and AnsibleContext
This commit is contained in:
@@ -345,11 +345,7 @@ class Templar:
|
||||
if hasattr(variable, '__UNSAFE__'):
|
||||
if isinstance(variable, text_type):
|
||||
rval = self._clean_data(variable)
|
||||
else:
|
||||
# Do we need to convert these into text_type as well?
|
||||
# return self._clean_data(to_text(variable._obj, nonstring='passthru'))
|
||||
rval = self._clean_data(variable._obj)
|
||||
return rval
|
||||
return rval
|
||||
|
||||
try:
|
||||
if convert_bare:
|
||||
|
||||
Reference in New Issue
Block a user