|
|
|
@ -742,7 +742,6 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|
|
|
|
|
|
|
|
|
# remove internal keys
|
|
|
|
|
self._remove_internal_keys(data)
|
|
|
|
|
data['_ansible_parsed'] = True
|
|
|
|
|
|
|
|
|
|
# cleanup tmp?
|
|
|
|
|
if (self._play_context.become and self._play_context.become_user != 'root') and not persist_files and delete_remote_tmp or tmpdir_delete:
|
|
|
|
@ -767,7 +766,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|
|
|
|
|
|
|
|
|
def _remove_internal_keys(self, data):
|
|
|
|
|
for key in list(data.keys()):
|
|
|
|
|
if key.startswith('_ansible_') or key in C.INTERNAL_RESULT_KEYS:
|
|
|
|
|
if key.startswith('_ansible_') and key != '_ansible_parsed' or key in C.INTERNAL_RESULT_KEYS:
|
|
|
|
|
display.warning("Removed unexpected internal key in module return: %s = %s" % (key, data[key]))
|
|
|
|
|
del data[key]
|
|
|
|
|
|
|
|
|
@ -824,6 +823,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|
|
|
|
if 'ansible_facts' in data and isinstance(data['ansible_facts'], dict):
|
|
|
|
|
self._clean_returned_data(data['ansible_facts'])
|
|
|
|
|
data['ansible_facts'] = wrap_var(data['ansible_facts'])
|
|
|
|
|
data['_ansible_parsed'] = True
|
|
|
|
|
except ValueError:
|
|
|
|
|
# not valid json, lets try to capture error
|
|
|
|
|
data = dict(failed=True, _ansible_parsed=False)
|
|
|
|
|