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/utils/__pycache__/job.cpython-310.pyc
o

�N�g�@sfdZddlZddlZddlZddlZddlZddlZe�e	�Z
ddd�Zddd�Zdd�Z
d	d
�ZdS)z.
Functions for interacting with the job cache
�Nc
s�tjj�tjj�|��}t�fdd�dD��rdStjj�|�d�s%dS|dur2tjj	|ddd�}|d}�d	d
krȈ�
d��
dg���d<d
�d<�d�d<d�|d�}z|j|��
dd�d��d	<Wn&t
yd|�d�}t�|�t
|��ty�tjd|dd�Ynw|�d�}z|j|�d	��Wnjt
y�d|�d�}t�|�t
|��ty�tjd|dd�YnEwtjj��d	��r|�d�}	z
|j|	d�d	d�Wn't
y�d|�d�}t�|�t
|��t�ytjd|dd�Ynw|�r2t�d�d�d	�|��tjj��d	d�dgd��|���|d �r=|�
d!��r?dS��
d	�dk�rTt�d"�d	�d�dS|�d�}
|�d#�}|�d$�}|�d%�}
d&�v�r���
d'i��r���
d'i�}d&|v�r���d&|d&i�d(|v�r���d(|d(i�z|j|
}|j|}|j|}Wnt
�y�}zd|�d)|��}t�|�t
|��d}~wwd}|d*k�r�|j|��
d	d+���r�d}|�rz|j|
�d	��Wn*t
�y}zt�d,|�WYd}~nd}~wt�ytjd|dd�Ynwz	|j|��Wnt�y0tjd|dd�Ynw|�
d-��rI|
|jv�rK|j|
�d	|�dSdSdS).zE
    Store job information using the configured master_job_cache
    c3s�|]}|�vVqdS)N�)�.0�key��loadr�B/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/job.py�	<genexpr>s�zstore_job.<locals>.<genexpr>)�return�jid�idFrN�ZstatesZrend�master_job_cacher
Zreq�argZfun_args�globZtgt_typeZtgtz{}.prep_jid�nocache)r�
Returner 'z$' does not support function prep_jidz1The specified '%s' returner threw a stack trace:
T)�exc_infoz
.save_loadz%' does not support function save_loadz/The specified '%s' returner threw a stack tracez	.prep_jid)Z
passed_jidzGot return from %s for job %s�retZjob�	job_cacheZ
ext_job_cachez3Ignoring job return with jid for caching %s from %sz	.get_loadz	.returnerz.update_endtimeZfunr	�userz' does not support function Zlocal_cache�zLoad does not contain 'jid': %sZjob_cache_store_endtime)�salt�utilsr
Zjid_to_timeZgen_jid�anyZverifyZvalid_id�minion�MasterMinion�get�format�	returners�KeyError�log�error�	Exception�criticalZis_jid�infoZ
fire_event�eventZtagifyZ
fire_ret_load�debug�update)�optsrr%�mminion�endtimerZ	prep_fstrZemsgZ
saveload_fstrZ
jidstore_fstrZsavefstrZgetfstrZfstrZupdateetfstrZret_Z
savefstr_funcZgetfstr_funcZ	fstr_funcr!Z	save_load�errr�	store_jobs�
�

��


��


���
�








��"�
��
���r,cCsf|dur
tjj|ddd�}|d}|�d�}z
|j||||d�WdSty2td|�d���w)	zk
    Store additional minions matched on lower-level masters using the configured
    master_job_cache
    NFrr
z
.save_minions)�	syndic_idrz(' does not support function save_minions)rrrrr)r(r
Zminionsr)r-rZminions_fstrrrr�
store_minions�s
�r.cCs<d}t|t�r|�dd�dkr|dSt|t�r|sdS|S)z0
    Determine a retcode for a given return
    r�retcode�)�
isinstance�dictr�bool)rr/rrr�get_retcode�sr4cCsD|�dd�}|�dd�}|dkr |dkr tjj�dd�|d}|S)a#
    Temporary function until 'keep_jobs' is fully deprecated,
    this will prefer 'keep_jobs_seconds', and only use
    'keep_jobs' as the configuration value if 'keep_jobs_seconds'
    is unmodified, and 'keep_jobs' is modified (in which case it
    will emit a deprecation warning).
    �keep_jobs_secondsi�Q�	keep_jobs�ZArgonzQThe 'keep_jobs' option has been deprecated and replaced with 'keep_jobs_seconds'.i)rrrZversionsZ
warn_until)r(r5r6rrr�get_keep_jobs_seconds�s�r8)NN)�__doc__�loggingZsalt.minionrZsalt.utils.eventZsalt.utils.jidZsalt.utils.verifyZsalt.utils.versions�	getLogger�__name__r r,r.r4r8rrrr�<module>s