|
|
|
@ -119,6 +119,15 @@ class TaskResult:
|
|
|
|
|
else:
|
|
|
|
|
ignore = _IGNORE
|
|
|
|
|
|
|
|
|
|
subset = {}
|
|
|
|
|
# preserve subset for later
|
|
|
|
|
for sub in _SUB_PRESERVE:
|
|
|
|
|
if sub in self._result:
|
|
|
|
|
subset[sub] = {}
|
|
|
|
|
for key in _SUB_PRESERVE[sub]:
|
|
|
|
|
if key in self._result[sub]:
|
|
|
|
|
subset[sub][key] = self._result[sub][key]
|
|
|
|
|
|
|
|
|
|
if isinstance(self._task.no_log, bool) and self._task.no_log or self._result.get('_ansible_no_log', False):
|
|
|
|
|
x = {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
|
|
|
|
|
|
|
|
|
@ -127,14 +136,6 @@ class TaskResult:
|
|
|
|
|
if preserve in self._result:
|
|
|
|
|
x[preserve] = self._result[preserve]
|
|
|
|
|
|
|
|
|
|
# preserve subset
|
|
|
|
|
for sub in _SUB_PRESERVE:
|
|
|
|
|
if sub in self._result:
|
|
|
|
|
x[sub] = {}
|
|
|
|
|
for key in _SUB_PRESERVE[sub]:
|
|
|
|
|
if key in self._result[sub]:
|
|
|
|
|
x[sub][key] = self._result[sub][key]
|
|
|
|
|
|
|
|
|
|
result._result = x
|
|
|
|
|
elif self._result:
|
|
|
|
|
result._result = module_response_deepcopy(self._result)
|
|
|
|
@ -147,4 +148,7 @@ class TaskResult:
|
|
|
|
|
# remove almost ALL internal keys, keep ones relevant to callback
|
|
|
|
|
strip_internal_keys(result._result, exceptions=CLEAN_EXCEPTIONS)
|
|
|
|
|
|
|
|
|
|
# keep subset
|
|
|
|
|
result._result.update(subset)
|
|
|
|
|
|
|
|
|
|
return result
|
|
|
|
|