pyanaconda.modules.timezone.timezone_interface

Classes

TimezoneInterface

DBus interface for Timezone module.

Module Contents

class pyanaconda.modules.timezone.timezone_interface.TimezoneInterface[source]

Bases: pyanaconda.modules.common.base.KickstartModuleInterface

DBus interface for Timezone module.

connect_signals()[source]

Connect the signals.

property Timezone: Str[source]

Timezone the system will use.

Return type:

Str

SetTimezoneWithPriority(timezone, priority)[source]

Set the timezone with a given priority.

Sets the system time zone to timezone, if the already stored timezone does not have higher priority.

To view a list of available time zones, use the timedatectl list-timezones command.

Example: Europe/Prague

The priority is a positive number. Use values defined in pyanaconda.core.constants as TIMEZONE_PRIORITY_* :

TIMEZONE_PRIORITY_DEFAULT = 0 TIMEZONE_PRIORITY_LANGUAGE = 30 TIMEZONE_PRIORITY_GEOLOCATION = 50 TIMEZONE_PRIORITY_KICKSTART = 70 TIMEZONE_PRIORITY_USER = 90

Parameters:
  • timezone (Str) – a string with a timezone specification in the Olson db aka tzdata format

  • priority (UInt16) – priority for the timezone; see the respective constants

GetAllValidTimezones()[source]

Get valid timezones.

Return a dictionary, where keys are region ids and values are lists of timezone names in the region.

Returns:

a dictionary of timezone lists per region

Return type:

Dict[Str, List[Str]]

property IsUTC: Bool[source]

Is the hardware clock set to UTC?

The system assumes that the hardware clock is set to UTC (Greenwich Mean) time, if true.

Returns:

True, if the hardware clock set to UTC, otherwise False

Return type:

Bool

property NTPEnabled: Bool[source]

Is automatic starting of NTP service enabled?

Returns:

True, if the service is enabled, otherwise false.

Return type:

Bool

property TimeSources: List[Structure][source]

A list of time sources.

Returns:

a list of time source data

Return type:

a list of structures of the type TimeSourceData

StartGeolocationWithTask()[source]

Start geolocation with task.

Returns:

a DBus path of the task

Return type:

ObjPath

property GeolocationResult: Structure[source]

Get geolocation result, if any.

Return DBusData:

geolocation result data

Return type:

Structure

GetSystemDateTime()[source]

Get the current local date and time of the system.

The timezone set via the Timezone property affects the returned data.

Returns:

a string representing the date and time in ISO 8601 format

Return type:

Str

SetSystemDateTime(date_time_spec)[source]

Set the current local date and time of the system.

The timezone set via the Timezone property will be applied to the received data.

Parameters:

date_time_spec (Str) – a string representing the date and time in ISO 8601 format