HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/sysmod.cpython-310.pyc
o

�N�g[Z�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Ze�
e�ZdZ
dgZdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zd2dd�Zd2dd�Zd2dd�Zd2dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z d*d+�Z!d,d-�Z"d.d/�Z#d2d0d1�Z$dS)3zQ
The sys module provides information about the available functions on the minion
�N�sys�*cCstS)z
    Return as sys
    )�__virtualname__�rr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/sysmod.py�__virtual__srcGs�i}|stD]	}t|j||<qtjj�|�S|D]E}d}d|vr&|}d}n|r4|�d�s1|dn|}nd}|rIt�t|�D]	}t|j||<q>qtD]}||ksV|�	|�r]t|j||<qKqtjj�|�S)ai
    Return the docstrings for all modules. Optionally, specify a module or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple modules/functions can be specified.

    CLI Example:

    .. code-block:: bash

        salt '*' sys.doc
        salt '*' sys.doc sys
        salt '*' sys.doc sys.doc
        salt '*' sys.doc network.traceroute user.info

    Modules can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.doc 'sys.*'
        salt '*' sys.doc 'sys.list_*'
    FrT�.�)
�__salt__�__doc__�salt�utils�doc�	strip_rst�endswith�fnmatch�filter�
startswith)�args�docs�fun�module�_use_fnmatch�
target_modrrrrs.���rcGs�tj�t�}i}|s<|jD]'}|�d�d}||vr,t|j|d�r,|j|jd||<|j|j||<q
tj	j
�|�S|D]}d}d|vrK|}d}n|rY|�d�sV|dn|}nd}|r�t
�|j|�D]#}|�d�d}t|j|d�r|j|jd||<|j|j||<qdq>|jD]0}||ks�|�|�r�|�d�d}||vr�t|j|d�r�|j|jd||<|j|j||<q�q>tj	j
�|�S)	a�
    Return the docstrings for all states. Optionally, specify a state or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple states/functions can be specified.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.state_doc
        salt '*' sys.state_doc service
        salt '*' sys.state_doc service.running
        salt '*' sys.state_doc service.running ipables.append

    State names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.state_doc 'service.*' 'iptables.*'

    rr�__globals__rFrTr	)r�state�State�__opts__�states�split�hasattrrrr
rrrrrr)r�st_rrrrrrrrr�	state_docVsF
�
��r"cGs�tj�t�}i}|s|jD]
}|j|j||<q
tjj�|�S|D]I}d}d|vr.|}d}n|r<|�	d�s9|dn|}nd}|rSt
�|j|�D]
}|j|j||<qGq!|jD]}||ksa|�|�ri|j|j||<qVq!tjj�|�S)a�
    Return the docstrings for all runners. Optionally, specify a runner or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple runners/functions can be specified.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.runner_doc
        salt '*' sys.runner_doc cache
        salt '*' sys.runner_doc cache.grains
        salt '*' sys.runner_doc cache.grains mine.get

    Runner names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.runner_doc 'cache.clear_*'

    FrTrr	)
r�runner�Runnerr�	functionsrr
rrrrrr)r�run_rrrrrrrr�
runner_doc�s0
�
��r'cGs�tj�tg�}i}|s|D]	}||j||<q
tjj�|�S|D]L}d}d|vr-|}d}n|r;|�d�s8|dn|}nd}|rU|D]}||ksL|�	|�rS||j||<qAq |�
�D]}||ksd|�	|�rk||j||<qYq tjj�|�S)a�
    Return the docstrings for all returners. Optionally, specify a returner or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple returners/functions can be specified.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.returner_doc
        salt '*' sys.returner_doc sqlite3
        salt '*' sys.returner_doc sqlite3.get_fun
        salt '*' sys.returner_doc sqlite3.get_fun etcd.get_fun

    Returner names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.returner_doc 'sqlite3.get_*'

    FrTrr	)r�loader�	returnersrrr
rrrr�keys)r�
returners_rrrrrrrr�returner_doc�s4����r,cGs�tj�tg�}i}|s |��D]	}||j||<qtjj�|�S|D]2}d|vs,d|vr=t	�
||�D]	}||j||<q2q"|d}|��D]}|�|�rS||j||<qEq"tjj�|�S)a>
    Return the docstrings for all renderers. Optionally, specify a renderer or a
    function to narrow the selection.

    The strings are aggregated into a single document on the master for easy
    reading.

    Multiple renderers can be specified.

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.renderer_doc
        salt '*' sys.renderer_doc cheetah
        salt '*' sys.renderer_doc jinja json

    Renderer names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.renderer_doc 'c*' 'j*'

    rr)rr(�renderrr*rr
rrrrr)r�
renderers_r�funcr�	moduledotrrr�renderer_docs$�
��r1cOsx|stt�St�}|D],}d|vsd|vr$t�t|�D]}|�|�qq|d}tD]}|�|�r6|�|�q*qt|�S)a'
    List the functions for all modules. Optionally, specify a module or modules
    from which to list.

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_functions
        salt '*' sys.list_functions sys
        salt '*' sys.list_functions sys user

    .. versionadded:: 0.12.0

    .. code-block:: bash

        salt '*' sys.list_functions 'module.specific_function'

    Function names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_functions 'sys.list_*'

    rr)�sortedr
�setrr�addr)r�kwargs�namesrr/r0rrr�list_functions@s�

��r7cGs�t�}|stD]}|�|�d�d�qt|�S|D]/}d|vr4t�t|�D]}|�|�d�d�q&qtD]}|�d�d}||krH|�|�q6qt|�S)a
    List the modules loaded on the minion

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_modules

    Module names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.list_modules 's*'

    rrr)r3r
r4rr2rr)r�modulesr/r�mod_testrrr�list_modulesqs"�
��r:cCsdS)z�
    Tell the minion to reload the execution modules

    CLI Example:

    .. code-block:: bash

        salt '*' sys.reload_modules
    Trrrrr�reload_modules�sr;r	cCstjj�t|�S)ay
    Return the argument specification of functions in Salt execution
    modules.

    CLI Example:

    .. code-block:: bash

        salt '*' sys.argspec pkg.install
        salt '*' sys.argspec sys
        salt '*' sys.argspec

    Module names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.argspec 'pkg.*'

    )rr
r�argspec_reportr
)rrrr�argspec�sr=cC�tj�t�}tjj�|j|�S)a�
    Return the argument specification of functions in Salt state
    modules.

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.state_argspec pkg.installed
        salt '*' sys.state_argspec file
        salt '*' sys.state_argspec

    State names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.state_argspec 'pkg.*'

    )rrrrr
rr<r)rr!rrr�
state_argspec�sr?cCstj�tg�}tjj�||�S)a�
    Return the argument specification of functions in Salt returner
    modules.

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.returner_argspec xmpp
        salt '*' sys.returner_argspec xmpp smtp
        salt '*' sys.returner_argspec

    Returner names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.returner_argspec 'sqlite3.*'

    )rr(r)rr
rr<)rr+rrr�returner_argspec�sr@cCr>)a�
    Return the argument specification of functions in Salt runner
    modules.

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.runner_argspec state
        salt '*' sys.runner_argspec http
        salt '*' sys.runner_argspec

    Runner names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.runner_argspec 'winrepo.*'
    )rr#r$rr
rr<r%)rr&rrr�runner_argspec�srAcO�tj�t�}|s
t|j�St�}|D].}d|vsd|vr,t�|j|�D]}|�	|�q#q|d}|jD]}|�
|�r?|�	|�q3qt|�S)a�
    List the functions for all state modules. Optionally, specify a state
    module or modules from which to list.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_state_functions
        salt '*' sys.list_state_functions file
        salt '*' sys.list_state_functions pkg user

    State function names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_state_functions 'file.*'
        salt '*' sys.list_state_functions 'file.s*'

    .. versionadded:: 2016.9.0

    .. code-block:: bash

        salt '*' sys.list_state_functions 'module.specific_function'

    rr)rrrrr2rr3rrr4r)rr5r!r6rr/r0rrr�list_state_functions
s "
�


��rCcGs�tj�t�}t�}|s%|jD]}t�d|�|�|�	d�d�qt
|�S|D]1}d|vrBt�|j|�D]}|�|�	d�d�q4q'|jD]}|�	d�d}||krW|�|�qEq't
|�S)aE
    List the modules loaded on the minion

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_state_modules

    State module names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_state_modules 'mysql_*'

    zfunc %srrr)
rrrrr3r�log�debugr4rr2rr)rr!r8r/rr9rrr�list_state_modulesBs&
�

��rFcGs�tj�t�}t�}|s|jD]}|�|�d�d�qt|�S|D]1}d|vr<t	�
|j|�D]}|�|�d�d�q.q!|jD]}|�d�d}||krQ|�|�q?q!t|�S)a.
    List the runners loaded on the minion

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_runners

    Runner names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_runners 'm*'

    rrr)rr#r$rr3r%r4rr2rr)rr&Zrunnersr/rr9rrr�list_runnersls$
�

��rGcOrB)a

    List the functions for all runner modules. Optionally, specify a runner
    module or modules from which to list.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_runner_functions
        salt '*' sys.list_runner_functions state
        salt '*' sys.list_runner_functions state virt

    Runner function names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_runner_functions 'state.*' 'virt.*'

    rr)rr#r$rr2r%r3rrr4r)rr5r&r6rr/r0rrr�list_runner_functions�s 
�


��rHcGs�tj�tg�}t�}|s!|��D]}|�|�d�d�qt|�S|D]/}d|vr=t	�
||�D]}|�|�d�d�q/q#|D]}|�d�d}||krQ|�|�q?q#t|�S)a6
    List the returners loaded on the minion

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_returners

    Returner names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_returners 's*'

    rrr)rr(r)rr3r*r4rr2rr)rr+r)r/rr9rrr�list_returners�s$�
��rIcOs�tj�tg�}|s
t|�St�}|D],}d|vsd|vr+t�||�D]}|�|�q"q|d}|D]}|�	|�r=|�|�q1qt|�S)a
    List the functions for all returner modules. Optionally, specify a returner
    module or modules from which to list.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_returner_functions
        salt '*' sys.list_returner_functions mysql
        salt '*' sys.list_returner_functions mysql etcd

    Returner names can be specified as globs.

    .. versionadded:: 2015.5.0

    .. code-block:: bash

        salt '*' sys.list_returner_functions 'sqlite3.get_*'

    rr)
rr(r)rr2r3rrr4r)rr5r+r6rr/r0rrr�list_returner_functions�s �

��rJcGsftj�tg�}t�}|s|��D]}|�|�qt|�S|D]}t�	||�D]}|�|�q&qt|�S)a
    List the renderers loaded on the minion

    .. versionadded:: 2015.5.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.list_renderers

    Render names can be specified as globs.

    .. code-block:: bash

        salt '*' sys.list_renderers 'yaml*'

    )
rr(r-rr3r*r4r2rr)rr.Z	renderersZrendrrrr�list_rendererss�rKc	
Cs:|d}|dp	g}|dt|�t|��}tt|t|�d�|��}||d�}|D]0}tjjjtjjj||dd�tjjj||dd�tjjj	||dd�tjjj
||dd�fd�||<q+|D]2\}}tjjjtjjj|||d�tjjj|||d�tjjj	|||d�tjjj
|||d�fd�||<q^t|tjjjf|��
�S)Nr�defaults)�title�descriptionT)rMrN�required)�items)rMrN�default)�len�list�ziprr
ZschemaZ	OneOfItemZBooleanItemZIntegerItemZ
NumberItemZ
StringItem�typeZSchemaZ	serialize)	�mod�specrrLZargs_reqZ
args_defaults�types�i�jrrr�_argspec_to_schema:s0�����r[cCs2t|�}g}|��D]\}}|�t||��q
|S)z�
    Return a JSON Schema for the given state function(s)

    .. versionadded:: 2016.3.0

    CLI Example:

    .. code-block:: bash

        salt '*' sys.state_schema
        salt '*' sys.state_schema pkg.installed
    )r?rP�appendr[)rZspecsZschemasZ	state_modZ
state_specrrr�state_schemaas

r])r	)%rr�loggingZsalt.loaderrZsalt.runnerZ
salt.stateZsalt.utils.argsZsalt.utils.docZsalt.utils.schema�	getLogger�__name__rDrZ__proxyenabled__rrr"r'r,r1r7r:r;r=r?r@rArCrFrGrHrIrJrKr[r]rrrr�<module>sD
8F:<.1%



5*(.).!'