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/thorium/__pycache__/key.cpython-310.pyc
o

�N�g��@s*dZddlZddlZdd�Zddd�ZdS)zs
The key Thorium State is used to apply changes to the accepted/rejected/pending keys

.. versionadded:: 2016.11.0
�NcCs dtvrtj�t�td<tdS)z!
    Return the key api hook
    �keyapi)�__context__�salt�keyZKeyZ__opts__�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/thorium/key.py�_get_key_apisrcCs�|iddd�}t��}d}|tvrit|<t�}t�}t�}|�d�}	|	�dg�D]d}
|
tddvr^|rH|tdd|
d	|krH|�|
�|r]|tdd|
d	|kr]|�|
�q)|
t|vrk|t||
<q)|r||t||
|kr||�|
�|r�|t||
|kr�|�|
�q)|D]}
|�|
�tdd�	|
d
�t|�	|
d
�q�|D]}
|�
|
�tdd�	|
d
�t|�	|
d
�q�|S)a�
    If any minion's status is older than the timeout value then apply the
    given action to the timed out key. This example will remove keys to
    minions that have not checked in for 300 seconds (5 minutes)

    USAGE:

    .. code-block:: yaml

        statreg:
          status.reg

        clean_keys:
          key.timeout:
            - require:
              - status: statreg
            - delete: 300
    �T)�nameZchangesZcomment�resultZkey_start_tracker�accZminions�status�valZ	recv_timeN)�timer�setrZlist_status�getZ__reg__�addZ
delete_key�pop�reject)r
�deleter�ret�nowZktr�removeZ
reject_setr�currentZid_rrr�timeouts@
 
 
�

�

r)rr)�__doc__rZsalt.keyrrrrrrr�<module>s