Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop adding 'process-end' audit entry #538

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion leapp/libraries/stdlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ def run(args, split=False, callback_raw=_console_logging_handler, callback_lineb
'stdout': result['stdout'].splitlines()
})
finally:
create_audit_entry('process-end', _id)
create_audit_entry('process-result', {'id': _id, 'parameters': args, 'result': result, 'env': env})
api.current_logger().debug('External command is finished: [%s]', ' '.join(args))
return result
4 changes: 2 additions & 2 deletions leapp/utils/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def create_audit_entry(event, data, message=None):
"""
Create an audit entry

:param event: Type of this event e.g. process-start or process-end but can be anything
:param event: Event type identifier
:param data: Data related to Type of the event, e.g. a command and its arguments
:param message: An optional message.
:return:
Expand All @@ -283,7 +283,7 @@ def get_audit_entry(event, context):

:param context: The execution context
:type context: str
:param event: Type of this event e.g. process-start or process-end but can be anything
:param event: Event type identifier
:type event: str
:return: list of dicts with id, time stamp, actor and phase fields
"""
Expand Down
2 changes: 0 additions & 2 deletions tests/scripts/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,5 @@ def test_audit_command_in_db(monkeypatch):
assert result['stdout'] in ['travis\n', 'root\n']
event = 'process-start'
assert get_audit_entry(event, _CONTEXT_NAME)
event = 'process-end'
assert get_audit_entry(event, _CONTEXT_NAME)
event = 'process-result'
assert get_audit_entry(event, _CONTEXT_NAME)