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__/logrotate.cpython-310.pyc
o

�N�gQ�@s6dZdZdZddiZdd�Zdd�Zd	efd
d�Zd	S)z=
Module for managing logrotate.

.. versionadded:: 2017.7.0

z/etc/logrotate.confZ	logrotate�set_�setcCsdtvrtSdS)z>
    Load only on minions that have the logrotate module.
    zlogrotate.show_conf)Fz$logrotate module could not be loaded)�__salt__�__virtualname__�rr�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/logrotate.py�__virtual__srcCs(z	tt|��}W|StyY|Sw)z�
    Convert to an int if necessary.

    :param str value: The value to check/convert.

    :return: The converted or passed value.
    :rtype: bool|int|str
    )�int�str�
ValueError)�valuerrr�_convert_if_ints	��rNc	Cs�|t�ddd�}z|durtd||d�}n	td|||d�}Wn
ttfy-d}Ynw|dur�t|�}||krJd|�d	|��|d
<d|d<|Std
rad|�d|��|d
<||d�|d<|S||d�|d<td|||d�|d<|dr�d|�d|��|d
<|Sd�||�|d
<|St|�}||kr�d�|||�|d
<d|d<|Std
r�d�|||�|d
<||d�|d<|S||d�|d<td||||d�|d<|dr�d�|||�|d
<|Sd�|||�|d
<|S)a3
    Set a new value for a specific configuration line.

    :param str key: The command or block to configure.
    :param str value: The command value or command of the block specified by the key parameter.
    :param str setting: The command value for the command specified by the value parameter.
    :param str conf_file: The logrotate configuration file.

    Example of usage with only the required arguments:

    .. code-block:: yaml

        logrotate-rotate:
          logrotate.set:
            - key: rotate
            - value: 2

    Example of usage specifying all available arguments:

    .. code-block:: yaml

        logrotate-wtmp-rotate:
          logrotate.set:
            - key: /var/log/wtmp
            - value: rotate
            - setting: 2
            - conf_file: /etc/logrotate.conf
    �N)�name�changes�comment�resultz
logrotate.get)�key�	conf_file)rrrFz	Command 'z' already has value: rTr�testz' will be set to value: )�old�newrz
logrotate.setz
Set command 'z	' value: z$Unable to set command '{}' value: {}z-Block '{}' command '{}' already has value: {}z0Block '{}' command '{}' will be set to value: {})rr�settingrz%Set block '{}' command '{}' value: {}z/Unable to set block '{}' command '{}' value: {})�dictr�AttributeError�KeyErrorrZ__opts__�format)rrrrr�retZ
current_valuerrrr*st�����
�������
����)�__doc__Z
_DEFAULT_CONFrZ__func_alias__rrrrrrr�<module>s