mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Tests: - Setting timezone shows: - In the interface and - timedatectl Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
14 lines
353 B
Python
14 lines
353 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""Set time zone with timedatectl."""
|
|
|
|
import subprocess
|
|
|
|
from plinth.actions import privileged
|
|
|
|
|
|
@privileged
|
|
def set_timezone(timezone: str):
|
|
"""Set time zone with timedatectl."""
|
|
command = ['timedatectl', 'set-timezone', timezone]
|
|
subprocess.run(command, stdout=subprocess.DEVNULL, check=True)
|