HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/timezone.cpython-310.pyc
o

�N�g�
�@s*dZddlmZmZdd�Zd	dd�ZdS)
a.
Management of timezones
=======================

The timezone can be managed for the system:

.. code-block:: yaml

    America/Denver:
      timezone.system

The system and the hardware clock are not necessarily set to the same time.
By default, the hardware clock is set to localtime, meaning it is set to the
same time as the system clock. If `utc` is set to True, then the hardware clock
will be set to UTC, and the system clock will be an offset of that.

.. code-block:: yaml

    America/Denver:
      timezone.system:
        - utc: True

.. _here: https://help.ubuntu.com/community/UbuntuTime#Multiple_Boot_Systems_Time_Conflicts

The Ubuntu community documentation contains an explanation of this setting, as
it applies to systems that dual-boot with Windows. This is explained in greater
detail here_.
�)�CommandExecutionError�SaltInvocationErrorcCsdtvrdSdS)zC
    Only load if the timezone module is available in __salt__
    ztimezone.get_zoneT)Fz#timezone module could not be loaded)�__salt__�rr�H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/timezone.py�__virtual__!srTc

Cs|iddd�}d}d}ztd|�}Wn"ttfy5}zd|d<d�||�|d<|WYd}~Sd}~wwd	}g}td
�dkrCd}|d	urUd	|d<|�d|�d
��nd	}|rd||krdd|d<d	}n|rr||krr|�d|���|dd	ur�d�|�|d<|Stdr�g}|dur�|�d|�d��|r�||kr�|�d|���d�|�|d<|Sg}|r�td|�r�||dd<|�d|���d	|d<n	|�d�d|d<|r�d}	|r�d}	td|	�r�||dd<|�d|���d	|d<n|�d|���d|d<d�|�|d<|S)z�
    Set the timezone for the system.

    name
        The name of the timezone to use (e.g.: America/Denver)

    utc
        Whether or not to set the hardware clock to UTC (default is True)
    N�)�name�changes�result�commentFztimezone.zone_comparerz>Unable to compare desired timezone '{}' to system timezone: {}rTztimezone.get_hwclock�	localtimez	Timezone z already setzUTC already set to z, �testz needs to be setzUTC needs to be set to ztimezone.set_zoner
�timezonez
Set timezone zFailed to set timezone�UTCztimezone.set_hwclock�utczSet UTC to zFailed to set UTC to )rrr�format�append�joinZ__opts__)
r	r�retZdo_utcZdo_zoneZcompzone�excZmyutc�messagesZclockrrr�system*st
����	


rN)T)�__doc__Zsalt.exceptionsrrrrrrrr�<module>s