mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Tests: - Functional tests work - Accessing help/status-log/ works and last 100 logs lines are shown. - When there are no logs, '--no entries--' message is shown. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
15 lines
393 B
Python
15 lines
393 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""Actions for help module."""
|
|
|
|
import subprocess
|
|
|
|
from plinth.actions import privileged
|
|
|
|
|
|
@privileged
|
|
def get_logs() -> str:
|
|
"""Get latest FreedomBox logs."""
|
|
command = ['journalctl', '--no-pager', '--lines=100', '--unit=plinth']
|
|
process = subprocess.run(command, check=True, stdout=subprocess.PIPE)
|
|
return process.stdout.decode()
|