From 4dea9d84edfdd1e8a2b28b8a510be234ddf12dd4 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 27 Aug 2018 14:19:06 -0400 Subject: [PATCH] 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 --- lib/ansible/executor/task_executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index cc54f92f378..979bd472c99 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -171,10 +171,10 @@ class TaskExecutor: display.debug("done dumping result, returning") return res 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: 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: try: self._connection.close()