mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
now passes the test of skipping list when dict attribute is undefined, added deprecation warning as this seems like bad behaviour
This commit is contained in:
@@ -256,8 +256,8 @@ class Templar:
|
||||
# safely catch run failures per #5059
|
||||
try:
|
||||
ran = instance.run(loop_terms, variables=self._available_variables, **kwargs)
|
||||
except (AnsibleUndefinedVariable, UndefinedError):
|
||||
raise
|
||||
except (AnsibleUndefinedVariable, UndefinedError) as e:
|
||||
raise AnsibleUndefinedVariable(e)
|
||||
except Exception, e:
|
||||
if self._fail_on_lookup_errors:
|
||||
raise
|
||||
@@ -337,7 +337,7 @@ class Templar:
|
||||
return res
|
||||
except (UndefinedError, AnsibleUndefinedVariable), e:
|
||||
if fail_on_undefined:
|
||||
raise
|
||||
raise AnsibleUndefinedVariable(e)
|
||||
else:
|
||||
#TODO: return warning about undefined var
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user