mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-06 09:11:29 -07:00
better cleanup on task results display (#27175)
* better cleanup on task results display callbacks get 'clean' copy of result objects moved cleanup into result object itself removed now redundant callback cleanup moved no_log tests * moved import as per feedback
This commit is contained in:
parent
03abce2d39
commit
01b6c7c9c6
6 changed files with 64 additions and 19 deletions
|
@ -138,3 +138,12 @@ class TestTaskResult(unittest.TestCase):
|
|||
# test with failed_when in result
|
||||
tr = TaskResult(mock_host, mock_task, dict(failed_when_result=True))
|
||||
self.assertTrue(tr.is_failed())
|
||||
|
||||
def test_task_result_no_log(self):
|
||||
mock_host = MagicMock()
|
||||
mock_task = MagicMock()
|
||||
|
||||
# no_log should remove secrets
|
||||
tr = TaskResult(mock_host, mock_task, dict(_ansible_no_log=True, secret='DONTSHOWME'))
|
||||
clean = tr.clean_copy()
|
||||
self.assertTrue('secret' not in clean._result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue