mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 22:31:25 -07:00
By popular request, make the no_log attribute also censor tasks from callbacks.
This commit is contained in:
parent
a04efa2d84
commit
99c39b1ff3
6 changed files with 61 additions and 3 deletions
|
@ -759,3 +759,22 @@ class TestUtils(unittest.TestCase):
|
|||
)
|
||||
|
||||
|
||||
def test_censor_unlogged_data(self):
|
||||
''' used by the no_log attribute '''
|
||||
input = dict(
|
||||
password='sekrit',
|
||||
rc=12,
|
||||
failed=True,
|
||||
changed=False,
|
||||
skipped=True,
|
||||
msg='moo',
|
||||
)
|
||||
data = ansible.utils.censor_unlogged_data(input)
|
||||
assert 'password' not in data
|
||||
assert 'rc' in data
|
||||
assert 'failed' in data
|
||||
assert 'changed' in data
|
||||
assert 'skipped' in data
|
||||
assert 'msg' not in data
|
||||
assert data['censored'] == 'results hidden due to no_log parameter'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue