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/runners/__pycache__/pillar.cpython-310.pyc
o

�N�g��@sRdZddlZddlZddlZe�e�Zd
dd�Zddd�Z	dd	d
�Z
ddd�ZdS)z>
Functions to interact with the pillar compiler on the master
�N�basecCsRtjj�|t�\}}}tj�t|||�}|��\}}|r't�	|dd�d�|S|S)z�
    Returns the compiled top data for pillar for a specific minion.  If no
    minion is specified, we use the first minion we find.

    CLI Example:

    .. code-block:: bash

        salt-run pillar.show_top
    �nested)�dataZ	outputterZprogress)
�salt�utils�minions�get_minion_data�__opts__�pillar�PillarZget_topZ
__jid_event__Z
fire_event)�minion�saltenv�id_�grains�_r
�top�errors�r�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/pillar.py�show_top
sr�*c
Ks�d}d}tjj�|t�\}}}|durd|i}|D]}|dkr$||}q|dkr-||}q||||<qtjjt||||d�}|��}	|	S)a�
    Returns the compiled pillar either of a specific minion
    or just the global available pillars. This function assumes
    that no minion has the id ``*``.
    Function also accepts pillarenv as attribute in order to limit to a specific pillar branch of git

    CLI Example:

    shows minion specific pillar:

    .. code-block:: bash

        salt-run pillar.show_pillar 'www.example.com'

    shows global pillar:

    .. code-block:: bash

        salt-run pillar.show_pillar

    shows global pillar for 'dev' pillar environment:
    (note that not specifying pillarenv will merge all pillar environments
    using the master config option pillar_source_merging_strategy.)

    .. code-block:: bash

        salt-run pillar.show_pillar 'pillarenv=dev'

    shows global pillar for 'dev' pillar environment and specific pillarenv = dev:

    .. code-block:: bash

        salt-run pillar.show_pillar 'saltenv=dev' 'pillarenv=dev'

    API Example:

    .. code-block:: python

        import salt.config
        import salt.runner
        opts = salt.config.master_config('/etc/salt/master')
        runner = salt.runner.RunnerClient(opts)
        pillar = runner.cmd('pillar.show_pillar', [])
        print(pillar)
    Nr�fqdnr
�	pillarenv�r)rrrrr	r
rZcompile_pillar)
r�kwargsrr
rrr�keyr
Zcompiled_pillarrrr�show_pillar$s.

rcKs�t�d�st�d�dStjj�t�}|�|�}|�	dd�}|�	dd�}i}|�dg�D]P}tjj�
|t�\}}	}
|D]}|||	|<q;|	durLd	|i}	tjjt|	|||d
�}|�
�t�d�dkrf|j}
n|jj}
||
vr||
|r||
�|��|�||<q,|S)
z�
    Clears the cached values when using pillar_cache

    .. versionadded:: 3003

    CLI Example:

    Clears the pillar cache for a specific minion:

    .. code-block:: bash

        salt-run pillar.clear_pillar_cache 'minion'

    �pillar_cache�0The pillar_cache is set to False or not enabled.FrNr
rrrr�pillar_cache_backend�memory)r	�get�log�inforrr�	CkMinions�
check_minions�poprr
�PillarCacheZclear_pillar�cache�_dict�rrZ	ckminions�retrr
rZtgtrrrrr
Z
_pillar_cacherrr�clear_pillar_cachegs2



��r,cKs�t�d�st�d�dStjj�t�}|�|�}|�	dd�}|�	dd�}i}|�dg�D]K}tjj�
|t�\}}	}
|D]}|||	|<q;|	durLd	|i}	tjjt|	|||d
�}t�d�dkrb|j
}
n|j
j}
||
vrw|
|rw|
|�|�||<q,|S)
z�
    Shows the cached values in pillar_cache

    .. versionadded:: 3003

    CLI Example:

    Shows the pillar cache for a specific minion:

    .. code-block:: bash

        salt-run pillar.show_pillar_cache 'minion'

    rrFrNr
rrrrrr )r	r!r"r#rrrr$r%r&rr
r'r(r)r*rrr�show_pillar_cache�s0



��r-)Nr)r)�__doc__�loggingZsalt.pillarrZsalt.utils.minions�	getLogger�__name__r"rrr,r-rrrr�<module>s



C4