diff options
author | Zuul <zuul@review.opendev.org> | 2022-05-03 05:37:49 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-05-03 05:37:49 +0000 |
commit | 4151f91684091411fc13c747fffe2114fdb4e25c (patch) | |
tree | 992dca4d92f5bfbe6de6e43c6ec472fb2aed5132 /zuul/ansible | |
parent | 4b3ee7a66bdf154fae7d5932d727c9a15cdcdb7b (diff) | |
parent | 7996f634fa3626530034214cfab5d63e2c431fb9 (diff) | |
download | zuul-4151f91684091411fc13c747fffe2114fdb4e25c.tar.gz |
Merge "zuul_json: remove no_log handling"
Diffstat (limited to 'zuul/ansible')
-rw-r--r-- | zuul/ansible/base/callback/zuul_json.py | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/zuul/ansible/base/callback/zuul_json.py b/zuul/ansible/base/callback/zuul_json.py index d8ff5f3fe..aff9ad2e2 100644 --- a/zuul/ansible/base/callback/zuul_json.py +++ b/zuul/ansible/base/callback/zuul_json.py @@ -135,35 +135,12 @@ class CallbackModule(CallbackBase): def v2_runner_on_ok(self, result, **kwargs): host = result._host action = result._task.action - if result._result.get('_ansible_no_log', False) or result._task.no_log: - self.results[-1]['tasks'][-1]['hosts'][host.name] = dict( - censored="the output has been hidden due to the fact that" - " 'no_log: true' was specified for this result") - else: - # strip_internal_keys makes a deep copy of dict items, but - # not lists, so we need to create our own complete deep - # copy first so we don't modify the original. - myresult = copy.deepcopy(result._result) - clean_result = strip_internal_keys(myresult) - - for index, item_result in enumerate( - clean_result.get('results', [])): - # If in a loop, this will be a list of result - # dictionaries. Otherwise for other tasks - # (yum/package are examples) each entry is a string. - if not hasattr(item_result, 'get'): - continue - # NOTE(ianw) 2022-04-21 : it is not entirely clear if - # results having _ansible_no_log here has actually - # been fixed upstream. For an abundance of caution, - # leave this. - if not item_result.get('_ansible_no_log', False): - continue - clean_result['results'][index] = dict( - censored="the output has been hidden due to the fact that" - " 'no_log: true' was specified for this result") - - self.results[-1]['tasks'][-1]['hosts'][host.name] = clean_result + # strip_internal_keys makes a deep copy of dict items, but + # not lists, so we need to create our own complete deep + # copy first so we don't modify the original. + myresult = copy.deepcopy(result._result) + clean_result = strip_internal_keys(myresult) + self.results[-1]['tasks'][-1]['hosts'][host.name] = clean_result end_time = current_time() self.results[-1]['tasks'][-1]['task']['duration']['end'] = end_time self.results[-1]['play']['duration']['end'] = end_time |