File: privileged.py

package info (click to toggle)
freedombox 26.2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 82,976 kB
  • sloc: python: 48,504; javascript: 1,736; xml: 481; makefile: 290; sh: 167; php: 32
file content (12 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Set time zone with timedatectl."""

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, check=True)