1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

properly sanitize registered vars

This commit is contained in:
Brian Coca 2015-10-30 16:42:06 -04:00
parent b6c92dacb5
commit f5b095f6c8

View file

@ -21,6 +21,7 @@ __metaclass__ = type
from ansible.compat.six.moves import queue from ansible.compat.six.moves import queue
from ansible.compat.six import iteritems, text_type from ansible.compat.six import iteritems, text_type
from ansible.vars import strip_internal_keys
import multiprocessing import multiprocessing
import time import time
@ -103,9 +104,13 @@ class ResultProcess(multiprocessing.Process):
time.sleep(0.01) time.sleep(0.01)
continue continue
clean_copy = strip_internal_keys(result._result)
if 'invocation' in clean_copy:
del clean_copy['invocation']
# if this task is registering a result, do it now # if this task is registering a result, do it now
if result._task.register: if result._task.register:
self._send_result(('register_host_var', result._host, result._task.register, result._result)) self._send_result(('register_host_var', result._host, result._task.register, clean_copy))
# send callbacks, execute other options based on the result status # send callbacks, execute other options based on the result status
# TODO: this should all be cleaned up and probably moved to a sub-function. # TODO: this should all be cleaned up and probably moved to a sub-function.