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

�N�g��@sNdZddlZddlZdZdd�Zdd�Zdd	�Z								
d
dd�ZdS)z^
Idem Support
============

This state provides access to idem states

.. versionadded:: 3002
�N�idemcCsdtvrtSdS)N�idem.hub)Fzidem is not available)�	__utils__�__virtualname__�rr�D/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/idem.py�__virtual__srcCs�g}g}|r|�d|���|D]2}t�|�}|��r=t|jdkr$|jn|j�}|�|�d|j��}||vr<|�|�q|�|�q||fS)z-
    Determine where the sls sources are
    zfile://z.sls)	�append�pathlib�Path�is_file�str�suffix�stem�name�parent)Zsources�tree�sls_sources�SLSs�sls�path�refZimpliedrrr�	_get_refss


�rcCs2t�d|�}|�d�|�d�|�d�|�d�d�S)z9
    Get salt-style low data from an idem state name
    z(.+)_\|-(.+)_\|-(.+)_\|-(.+)����)�stateZ__id__rZfun)�re�match�group)Zlow_datarrrr�
_get_low_data/s�r!Fc

Cs2td�}
t|t�r
|g}t||p|
jjj�\}}|
jjj|||p%|
jjj	|p+|
jjj
dg|p3|
jjj||	|p;|
jjj
|pA|
jjj|pI|
jjjpIdd�}
|
jj�|
�|
jj|d}|}g}|
jj|d��D]\}}|d|d|d	|�d
�t|�d�}|�|�qj|||r�dt|��d
�n|i|d�S)as
    Execute an idem sls file through a salt state

    sls
        A list of idem sls files or sources

    acct_file
        Path to the acct file used in generating idem ctx parameters.
        Defaults to the value in the ACCT_FILE environment variable.

    acct_key
        Key used to decrypt the acct file.
        Defaults to the value in the ACCT_KEY environment variable.

    acct_profile
        Name of the profile to add to idem's ctx.acct parameter
        Defaults to the value in the ACCT_PROFILE environment variable.

    cache_dir
        The location to use for the cache directory

    render
        The render pipe to use, this allows for the language to be specified (jinja|yaml)

    runtime
        Select which execution runtime to use (serial|parallel)

    source_dir
        The directory containing sls files

    .. code-block:: yaml

        cheese:
            idem.state:
                - runtime: parallel
                - sls:
                    - idem_state.sls
                    - sls_source

    :maturity:      new
    :depends:       acct, pop, pop-config, idem
    :platform:      all
    rZstates�default)rr�render�runtimeZsubs�	cache_dirr�test�	acct_file�acct_key�acct_profile�errors�runningr�changes�result�comment)rr,r-r.�lowzRan z idem states)rr-r.r,Z
sub_state_run)r�
isinstancer
rZOPTrrrZapplyr#r$r%Zacctr'r(r)�popZLoopZrun_until_completeZRUNS�items�getr!r	�len)rrr'r(r)r%r#r$Z
source_dirr&Zhubrr�coror*�successr+Z	idem_nameZidem_returnZstandardized_idem_returnrrrr=sF
7
�
��r)NNNNNNNF)�__doc__r
rrrrr!rrrrr�<module>s �