mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
fix issue with no_log in py3
the error percolates differently from undefined vars in jinja2, so fallback to use play_context as it is not involved in current templating
This commit is contained in:
@@ -171,10 +171,10 @@ class TaskExecutor:
|
|||||||
display.debug("done dumping result, returning")
|
display.debug("done dumping result, returning")
|
||||||
return res
|
return res
|
||||||
except AnsibleError as e:
|
except AnsibleError as e:
|
||||||
return dict(failed=True, msg=wrap_var(to_text(e, nonstring='simplerepr')), _ansible_no_log=self._task.no_log)
|
return dict(failed=True, msg=wrap_var(to_text(e, nonstring='simplerepr')), _ansible_no_log=self._play_context.no_log)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return dict(failed=True, msg='Unexpected failure during module execution.', exception=to_text(traceback.format_exc()),
|
return dict(failed=True, msg='Unexpected failure during module execution.', exception=to_text(traceback.format_exc()),
|
||||||
stdout='', _ansible_no_log=self._task.no_log)
|
stdout='', _ansible_no_log=self._play_context.no_log)
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
self._connection.close()
|
self._connection.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user