mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-02 08:38:52 +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:
parent
e511326222
commit
df3e4cd7f4
2 changed files with 365 additions and 20 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue