From b76cb8f655fa1f7ef4402738a8fc28d9208eb541 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 15 Jul 2015 10:40:37 -0400 Subject: [PATCH] now that invocation is only async again, no need to sanitize --- lib/ansible/constants.py | 1 - lib/ansible/executor/process/result.py | 6 +----- lib/ansible/plugins/callback/__init__.py | 16 ++-------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index c95cb34b454..43ae782e195 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -235,4 +235,3 @@ DEFAULT_SUBSET = None DEFAULT_SU_PASS = None VAULT_VERSION_MIN = 1.0 VAULT_VERSION_MAX = 1.0 -RESULT_SANITIZE = frozenset(['warnings']) diff --git a/lib/ansible/executor/process/result.py b/lib/ansible/executor/process/result.py index 5e09bd7f84a..baf7afcf5b4 100644 --- a/lib/ansible/executor/process/result.py +++ b/lib/ansible/executor/process/result.py @@ -33,7 +33,6 @@ try: except ImportError: HAS_ATFORK=False -from ansible import constants as C from ansible.playbook.handler import Handler from ansible.playbook.task import Task @@ -108,10 +107,7 @@ class ResultProcess(multiprocessing.Process): # if this task is registering a result, do it now if result._task.register: - res = {} - for k in set(result._result.keys()).difference(C.RESULT_SANITIZE): - res[k] = result._result[k] - self._send_result(('register_host_var', result._host, result._task.register, res)) + self._send_result(('register_host_var', result._host, result._task.register, result._result)) # send callbacks, execute other options based on the result status # FIXME: this should all be cleaned up and probably moved to a sub-function. diff --git a/lib/ansible/plugins/callback/__init__.py b/lib/ansible/plugins/callback/__init__.py index a13811b9541..ea56d758a7e 100644 --- a/lib/ansible/plugins/callback/__init__.py +++ b/lib/ansible/plugins/callback/__init__.py @@ -21,8 +21,6 @@ __metaclass__ = type import json -from ansible import constants as C - __all__ = ["CallbackBase"] @@ -45,18 +43,8 @@ class CallbackBase: version = getattr(self, 'CALLBACK_VERSION', 'unknwon') self._display.vvvv('Loaded callback %s of type %s, v%s' % (name, ctype, version)) - def _dump_results(self, result, sanitize=True, indent=4, sort_keys=True): - if sanitize: - res = self._sanitize_result(result) - else: - res = result - return json.dumps(res, indent=indent, ensure_ascii=False, sort_keys=sort_keys) - - def _sanitize_result(self, result): - res = {} - for k in set(result.keys()).difference(C.RESULT_SANITIZE): - res[k] = result[k] - return res + def _dump_results(self, result, indent=4, sort_keys=True): + return json.dumps(result, indent=indent, ensure_ascii=False, sort_keys=sort_keys) def set_connection_info(self, conn_info): pass