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

�N�g��@sHdZddlZe�e�Zdd�Zddd�Zddd	�Zdd
d�Zdd
�Z	dS)z�
Configuration disposable regularly scheduled tasks for at.
==========================================================

The at state can be add disposable regularly scheduled tasks for your system.
�NcCsdtvrdSdS)z:
    Most everything has the ability to support at(1)
    �at.atT)Fzat module could not be loaded)�__salt__�rr�B/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/at.py�__virtual__
srFc	CsF|iddd�}|s|}tdrd|d<d�||�|d<|S|rB|s+d	|d<d
|d<|Sttd|d�d
�dkrBd|�d�|d<|S|rntd|�}|sZd	|d<d|�d�|d<|Sd�|||�|d<td||||d�}nd�||�|d<td|||d�}d
|vr�t|d
�dkr�|d
d|d<d|vr�d	|d<|d|d<|S)a�
    .. versionchanged:: 2017.7.0

    Add a job to queue.

    job : string
        Command to run.

    timespec : string
        The 'timespec' follows the format documented in the at(1) manpage.

    tag : string
        Make a tag for the job.

    user : string
        The user to run the at job
        .. versionadded:: 2014.1.4

    unique_tag : boolean
        If set to True job will not be added if a job with the tag exists.
        .. versionadded:: 2017.7.0

    .. code-block:: yaml

        rose:
          at.present:
            - job: 'echo "I love saltstack" > love'
            - timespec: '9:09 11/09/13'
            - tag: love
            - user: jam

    T���name�changes�result�comment�testNrzjob {} added and will run on {}rFz-no tag provided and unique_tag is set to True�at.jobcheck)�tag�jobsrzatleast one job with tag z exists.z	user.infozuser z does not existsz%job {} added and will run as {} on {}r)rZrunasr
�error)�__opts__�format�lenr)	r	�timespecr�user�job�
unique_tag�retZluser�resrrr�presentsd!�����rc	Ks�|iddd�}d|vrd|��|d<d|d<|Std	r&d
|d<d|d<|S|r�td|�}d
|vrHt|d
�dkrHd|d<d|�d�|d<|Sd
|vr�t|d
�dkr�d|d
dvr�|d
ddr�td|�}||d
dv|d<|dr�dj|d�|d<ndj|d�|d<|d
d|dd<|Snd|d<dj|d�|d<|S|r�ttttdd�tdd i|��d
D����}td|�}ntdd�}t|d
d�dkr�|d
d|dd<djt|d
d�d�|d<|S)!a�
    .. versionchanged:: 2017.7.0

    Remove a job from queue

    jobid: string|int
        Specific jobid to remove

    tag : string
        Job's tag

    runas : string
        Runs user-specified jobs

    kwargs
        Addition kwargs can be provided to filter jobs.
        See output of `at.jobcheck` for more.

    .. code-block:: yaml

        example1:
          at.absent:

    .. warning::
        this will remove all jobs!

    .. code-block:: yaml

        example2:
          at.absent:
            - year: 13

    .. code-block:: yaml

        example3:
          at.absent:
            - tag: rose

    .. code-block:: yaml

        example4:
          at.absent:
            - tag: rose
            - day: 13
            - hour: 16

    .. code-block:: yaml

        example5:
          at.absent:
            - jobid: 4

    .. note:
        all other filters are ignored and only job with id 4 is removed
    Trr�limitzlimit parameter not supported rFrr
Nzremoved ? job(s)zat.atqrrzjob with id z not present�rzat.atrmZremovedzjob with id {jobid} was removed)�jobidz$failed to remove job with id {jobid}r
z4more than one job was return for job with id {jobid}cSsg|]}|d�qS)rr)�.0�jrrr�
<listcomp>�szabsent.<locals>.<listcomp>r�allzremoved {count} job(s))�countr)rrrr�list�map�str)r	r�kwargsrrr�optsrrr�absentws^8 �
����$��r)cCs|iddd�S)a
    .. versionadded:: 2017.7.0

    Add an at job if trigger by watch

    job : string
        Command to run.

    timespec : string
        The 'timespec' follows the format documented in the at(1) manpage.

    tag : string
        Make a tag for the job.

    user : string
        The user to run the at job
        .. versionadded:: 2014.1.4

    unique_tag : boolean
        If set to True job will not be added if a job with the tag exists.
        .. versionadded:: 2017.7.0

    .. code-block:: yaml

        minion_restart:
          at.watch:
            - job: 'salt-call --local service.restart salt-minion'
            - timespec: 'now +1 min'
            - tag: minion_restart
            - unique_tag: trye
            - watch:
                - file: /etc/salt/minion

    Trrr)r	rrrrrrrr�watch�s#r*cKsD|iddd�}|ddkr dD]}||=q||d<td	i|��}|S)
aW
    The at watcher, called to invoke the watch command.

    .. note::
        This state exists to support special handling of the ``watch``
        :ref:`requisite <requisites>`. It should not be called directly.

        Parameters for this function should be set by the state being triggered.

    name
        The name of the atjob

    Frr�sfunr*)r+Z__reqs__r	Nr)r)r	r'r�prrr�	mod_watchsr-)NNNF)N)
�__doc__�logging�	getLogger�__name__�logrrr)r*r-rrrr�<module>s

	
a
w&