mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
- This is to capture stdout and stderr and transmit that from privileged daemon back to the service to be displayed in HTML. Tests: - Unit tests and code checks pass. - Some of the modified actions work as expected. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
15 lines
387 B
Python
15 lines
387 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""Set time zone with timedatectl."""
|
|
|
|
import subprocess
|
|
|
|
from plinth import action_utils
|
|
from plinth.actions import privileged
|
|
|
|
|
|
@privileged
|
|
def set_timezone(timezone: str):
|
|
"""Set time zone with timedatectl."""
|
|
command = ['timedatectl', 'set-timezone', timezone]
|
|
action_utils.run(command, stdout=subprocess.DEVNULL, check=True)
|