%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/saltutil.pyo

�
���^c@@sbdZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZy&ddl
Z
ddl
mZeZWnek
r�eZnXddlmZddlmZy
e	jZWnek
re	jZnXddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#Zddl$Zddl%Zddl&Zddl'Zddl(Zddl)Zddl*Zddl+Zddl,ZeZ-yddl.ZWnek
reZ-nXddl/m0Z0m1Z1m2Z2m3Z3dgZ4ej5e6�Z7d	�Z8dddd
�Z:dd�Z;deddd�Z<dddd
�Z=deddd�Z>deddd�Z?d�Z@deddd�ZAdeddd�ZBdeddd�ZCdeddd�ZDdeddd�ZEdeddd�ZFdeddd�ZGdeddd�ZHejIjJjKeHd�ZLdeddd�ZMdeddd�ZNdeddd�ZOd�ZPdeddd�ZQdeddd�ZRdeddd �ZSd!�ZTd"�ZUed#d$�ZVejIjJjKeVd%�ZWd&�ZXd'�ZYd(�ZZd)�Z[d*d+�Z\d,�Z]d-�Z^d.�Z_d/�Z`d0�Zad1�Zbd2�Zcd3�Zded4�Zeed5�Zfd6�ZgdAdd7d8ded9�ZhdBdd7d8ded:�Zidded;dd<�Zjd=�Zkd>elfd?��YZmd@�ZndS(Cu�
The Saltutil module is used to manage the state of the salt minion itself. It
is used to manage minion modules as well as automate updates to the salt
minion.

:depends:   - esky Python module for update functionality
i(tabsolute_importtprint_functiontunicode_literalsN(tEskyVersionError(tsix(tURLError(tSaltReqTimeoutErrortSaltRenderErrortCommandExecutionErrortSaltInvocationErroru*cC@s�ytdSWn�tk
r�yXtjjtdt�}|j�}|rmt|j	|�j
��pgd}nd}Wn(tk
r�}tdj
|���nX|td<|SXdS(u0
    Get all environments from the top file
    usaltutil._top_file_envstinitial_pillarubaseu!Unable to render top file(s): {0}N(t__context__tKeyErrortsalttstatet	HighStatet__opts__t
__pillar__tget_toptlistttop_matchestkeysRRtformat(tst_ttoptenvstexc((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt_get_top_file_envsKs
	$

c	C@s9|dkrt�}nt|tj�r<|jd�}ntjjj	t
|d|d|d|�\}}|r�tjj
t
dd�}tjjj|d��WdQXn|d	kr5t
jd
�r5tjjtjj
t
dd��r5y$tjtjj
t
dd��Wq5tk
r1tjd�q5Xn|S(
u;
    Sync the given directory in the given environment
    u,tsaltenvtextmod_whitelisttextmod_blacklistucachedirumodule_refreshuaNugrainsugrains_cacheugrains.cache.puCould not remove grains cache!(tNoneRt
isinstanceRtstring_typestsplitR
tutilstextmodstsyncRtostpathtjointfilestfopentgettisfiletremovetOSErrortlogterror(tformRRRtretttouchedtmod_file((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt_syncbs$!	%$
cC@s�i}tsd|d<|Sttdt�s:d|d<|Stdd�sXd|d<|Stjtjtd�}t	d}|s�y|j
�}Wq�tk
r�}d	j|�|d<|SXn|s�d
|d<|Sy|j
|�Wn*tk
r}dj||�|d<|SXy|j|�Wn*tk
rM}dj||�|d<|SXy|j�Wn&tk
r�}d
j|�|d<nXi}x&tdD]}td|�||<q�Wdj||�|d<||d<|S(u�
    Update the salt minion from the URL defined in opts['update_url']
    SaltStack, Inc provides the latest builds here:
    update_url: https://repo.saltstack.com/windows/

    Be aware that as of 2014-8-11 there's a bug in esky such that only the
    latest version available in the update_url can be downloaded and installed.

    This feature requires the minion to be running a bdist_esky build.

    The version number is optional and will default to the most recent version
    available at opts['update_url'].

    Returns details about the transaction upon completion.

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.update
        salt '*' saltutil.update 0.10.3
    uEsky not available as importu_errorufrozenu#Minion is not running an Esky buildu
config.optionu
update_urlu*"update_url" not configured on this minionusaltversionu+Could not connect to update_url. Error: {0}uNo updates availableu'Unable to fetch version {0}. Error: {1}u)Unable to install version {0}. Error: {1}uUnable to cleanup. Error: {0}uupdate_restart_servicesuservice.restartuUpdated from {0} to {1}ucommentu	restarted(tHAS_ESKYtgetattrtsystFalset__salt__teskytEskyt
executableRt
__grains__tfind_updateRRt
fetch_versionRtinstall_versiontcleanupt	Exception(tversionR2tappt
oldversionRt	restartedtservice((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytupdate{sR





cC@s)td|||�}|r%t�n|S(u
    .. versionadded:: 2015.5.1

    Sync beacons from ``salt://_beacons`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for beacons to sync. If no top files are
        found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available beacons on the minion. This refresh
        will be performed even if no new beacons are synced. Set to ``False``
        to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.sync_beacons
        salt '*' saltutil.sync_beacons saltenv=dev
        salt '*' saltutil.sync_beacons saltenv=base,dev
    ubeacons(R5trefresh_beacons(RtrefreshRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_beacons�s!
cC@std|||�}|S(u�
    .. versionadded:: 2015.5.8,2015.8.3

    Sync sdb modules from ``salt://_sdb`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for sdb modules to sync. If no top files
        are found, then the ``base`` environment will be synced.

    refresh : False
        This argument has no affect and is included for consistency with the
        other sync functions.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.sync_sdb
        salt '*' saltutil.sync_sdb saltenv=dev
        salt '*' saltutil.sync_sdb saltenv=base,dev
    usdb(R5(RRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_sdb�s cC@s)td|||�}|r%t�n|S(uY
    .. versionadded:: 0.10.0

    Sync execution modules from ``salt://_modules`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for execution modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new execution modules are
        synced. Set to ``False`` to prevent this refresh.

    .. important::

        If this function is executed using a :py:func:`module.run
        <salt.states.module.run>` state, the SLS file will not have access to
        newly synced execution modules unless a ``refresh`` argument is
        added to the state, like so:

        .. code-block:: yaml

            load_my_custom_module:
              module.run:
                - name: saltutil.sync_modules
                - refresh: True

        See :ref:`here <reloading-modules>` for a more detailed explanation of
        why this is necessary.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.sync_modules
        salt '*' saltutil.sync_modules saltenv=dev
        salt '*' saltutil.sync_modules saltenv=base,dev
    umodules(R5trefresh_modules(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_moduless2
cC@s)td|||�}|r%t�n|S(u
    .. versionadded:: 0.10.0

    Sync state modules from ``salt://_states`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for state modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available states on the minion. This refresh
        will be performed even if no new state modules are synced. Set to
        ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_states
        salt '*' saltutil.sync_states saltenv=dev
        salt '*' saltutil.sync_states saltenv=base,dev
    ustates(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_states@s!
cK@s^tjjj|�}|jdt�}|rCtjjj|�nt�|rZt�ntS(u�
    .. versionadded:: 2016.3.6,2016.11.4,2017.7.0

    Refresh the minion's grains without syncing custom grains modules from
    ``salt://_grains``.

    .. note::
        The available execution modules will be reloaded as part of this
        proceess, as grains can affect which modules are available.

    refresh_pillar : True
        Set to ``False`` to keep pillar data from being refreshed.

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.refresh_grains
    urefresh_pillar(	R
R#targstclean_kwargstpoptTruetinvalid_kwargsRNtrefresh_pillar(tkwargst_refresh_pillar((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytrefresh_grainsgs
cC@s0td|||�}|r,t�t�n|S(uE
    .. versionadded:: 0.10.0

    Sync grains modules from ``salt://_grains`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for grains modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules and recompile
        pillar data for the minion. This refresh will be performed even if no
        new grains modules are synced. Set to ``False`` to prevent this
        refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_grains
        salt '*' saltutil.sync_grains saltenv=dev
        salt '*' saltutil.sync_grains saltenv=base,dev
    ugrains(R5RNRV(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_grains�s
"
cC@s)td|||�}|r%t�n|S(uQ
    .. versionadded:: 0.10.0

    Sync renderers from ``salt://_renderers`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for renderers to sync. If no top files
        are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new renderers are synced.
        Set to ``False`` to prevent this refresh. Set to ``False`` to prevent
        this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_renderers
        salt '*' saltutil.sync_renderers saltenv=dev
        salt '*' saltutil.sync_renderers saltenv=base,dev
    u	renderers(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_renderers�s"
cC@s)td|||�}|r%t�n|S(u�
    .. versionadded:: 0.10.0

    Sync returners from ``salt://_returners`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for returners to sync. If no top files
        are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new returners are synced. Set
        to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_returners
        salt '*' saltutil.sync_returners saltenv=dev
    u	returners(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_returners�s 
cC@s)td|||�}|r%t�n|S(u2
    .. versionadded:: 2015.8.2

    Sync proxy modules from ``salt://_proxy`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for proxy modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new proxy modules are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_proxymodules
        salt '*' saltutil.sync_proxymodules saltenv=dev
        salt '*' saltutil.sync_proxymodules saltenv=base,dev
    uproxy(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_proxymodules�s!
cC@s)td|||�}|r%t�n|S(u�
    .. versionadded:: 2019.2.0

    Sync engine modules from ``salt://_matchers`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for engines to sync. If no top files are
        found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new matcher modules are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-separated list of modules to sync

    extmod_blacklist : None
        comma-separated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_matchers
        salt '*' saltutil.sync_matchers saltenv=base,dev
    umatchers(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
sync_matchers&s 
cC@s)td|||�}|r%t�n|S(u�
    .. versionadded:: 2016.3.0

    Sync engine modules from ``salt://_engines`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for engines to sync. If no top files are
        found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new engine modules are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_engines
        salt '*' saltutil.sync_engines saltenv=base,dev
    uengines(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_enginesLs 
cC@s)td|||�}|r%t�n|S(u�
    .. versionadded:: 2018.3.0

    Sync Thorium modules from ``salt://_thorium`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for engines to sync. If no top files are
        found, then the ``base`` environment will be synced.

    refresh: ``True``
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new Thorium modules are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist
        comma-seperated list of modules to sync

    extmod_blacklist
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_thorium
        salt '*' saltutil.sync_thorium saltenv=base,dev
    uthorium(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_thoriumrs 
cC@s)td|||�}|r%t�n|S(u�
    Sync outputters from ``salt://_output`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for outputters to sync. If no top files
        are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new outputters are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_output
        salt '*' saltutil.sync_output saltenv=dev
        salt '*' saltutil.sync_output saltenv=base,dev
    uoutput(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_output�s
usync_outputterscC@s)td|||�}|r%t�n|S(uG
    .. versionadded:: 2017.7.0

    Sync cloud modules from ``salt://_cloud`` to the minion

    saltenv : base
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new utility modules are
        synced. Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_clouds
        salt '*' saltutil.sync_clouds saltenv=dev
        salt '*' saltutil.sync_clouds saltenv=base,dev
    uclouds(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_clouds�s
cC@s)td|||�}|r%t�n|S(u#
    .. versionadded:: 2014.7.0

    Sync utility modules from ``salt://_utils`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for utility modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new utility modules are
        synced. Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_utils
        salt '*' saltutil.sync_utils saltenv=dev
        salt '*' saltutil.sync_utils saltenv=base,dev
    uutils(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
sync_utils�s!
cC@s)td|||�}|r%t�n|S(u=
    .. versionadded:: 2019.2.0

    Sync serializers from ``salt://_serializers`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for serializer modules to sync. If no top
        files are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new serializer modules are
        synced. Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_serializers
        salt '*' saltutil.sync_serializers saltenv=dev
        salt '*' saltutil.sync_serializers saltenv=base,dev
    userializers(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_serializers
s!
cC@s�i}tjjtdd�}tj|�}x�|D]�}t�||<xdtjjjtjj||��D]>\}}}x,|D]$}||j	|j
d�d�q�WqmWt||�||<q5W|S(u�
    .. versionadded:: 2017.7.0

    List Salt modules which have been synced externally

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.list_extmods
    ucachediruextmodsu.i(R&R'R(RtlistdirtsetR
R#tos_walktaddR"R(R2text_dirt	mod_typestmod_typet_R)tfh_((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytlist_extmods1s

4
&cC@s)td|||�}|r%t�n|S(u6
    .. versionadded:: 2015.8.0

    Sync log handlers from ``salt://_log_handlers`` to the minion

    saltenv
        The fileserver environment from which to sync. To sync from more than
        one environment, pass a comma-separated list.

        If not passed, then all environments configured in the :ref:`top files
        <states-top>` will be checked for log handlers to sync. If no top files
        are found, then the ``base`` environment will be synced.

    refresh : True
        If ``True``, refresh the available execution modules on the minion.
        This refresh will be performed even if no new log handlers are synced.
        Set to ``False`` to prevent this refresh.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_log_handlers
        salt '*' saltutil.sync_log_handlers saltenv=dev
        salt '*' saltutil.sync_log_handlers saltenv=base,dev
    ulog_handlers(R5RN(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_log_handlersIs!
cC@sOtddkrtd��ntd|||�}|rKt�t�n|S(u
    .. versionadded:: 2015.8.11,2016.3.2

    Sync pillar modules from the ``salt://_pillar`` directory on the Salt
    fileserver. This function is environment-aware, pass the desired
    environment to grab the contents of the ``_pillar`` directory from that
    environment. The default environment, if none is specified,  is ``base``.

    refresh : True
        Also refresh the execution modules available to the minion, and refresh
        pillar data.

    extmod_whitelist : None
        comma-seperated list of modules to sync

    extmod_blacklist : None
        comma-seperated list of modules to blacklist based on type

    .. note::
        This function will raise an error if executed on a traditional (i.e.
        not masterless) minion

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_pillar
        salt '*' saltutil.sync_pillar saltenv=dev
    ufile_clientulocalu7Pillar modules can only be synced to masterless minionsupillar(RRR5RNRV(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_pillarps
cC@s�tjd�i}t|t||�|d<t|t||�|d<t|t||�|d<t|t||�|d<t|||�|d<t|t||�|d<t	|t||�|d<t
|t||�|d	<t|t||�|d
<t|t||�|d<t
|t||�|d<t|t||�|d
<t|t||�|d<t|t||�|d<t|t||�|d<t|t||�|d<tddkr�t|t||�|d<n|r�t�t�n|S(uL
    .. versionchanged:: 2015.8.11,2016.3.2
        On masterless minions, pillar modules are now synced, and refreshed
        when ``refresh`` is set to ``True``.

    Sync down all of the dynamic modules from the file server for a specific
    environment. This function synchronizes custom modules, states, beacons,
    grains, returners, output modules, renderers, and utils.

    refresh : True
        Also refresh the execution modules and recompile pillar data available
        to the minion. This refresh will be performed even if no new dynamic
        modules are synced. Set to ``False`` to prevent this refresh.

    .. important::

        If this function is executed using a :py:func:`module.run
        <salt.states.module.run>` state, the SLS file will not have access to
        newly synced execution modules unless a ``refresh`` argument is
        added to the state, like so:

        .. code-block:: yaml

            load_my_custom_module:
              module.run:
                - name: saltutil.sync_all
                - refresh: True

        See :ref:`here <reloading-modules>` for a more detailed explanation of
        why this is necessary.

    extmod_whitelist : None
        dictionary of modules to sync based on type

    extmod_blacklist : None
        dictionary of modules to blacklist based on type

    CLI Examples:

    .. code-block:: bash

        salt '*' saltutil.sync_all
        salt '*' saltutil.sync_all saltenv=dev
        salt '*' saltutil.sync_all saltenv=base,dev
        salt '*' saltutil.sync_all extmod_whitelist={'modules': ['custom_module']}
    uSyncing allucloudsubeaconsumodulesustatesusdbugrainsu	renderersu	returnersuoutputuutilsulog_handlersuproxymodulesuenginesuthoriumuserializersumatchersufile_clientulocalupillar(R/tdebugRbR9RLRORPRMRZR[R\RaRcRoR]R_R`RdR^RRpRNRV(RRKRRR2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytsync_all�s0/

cC@sBytdid�}Wn$tk
r=tjd�t}nX|S(u�
    Signal the minion to refresh the beacons.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.refresh_beacons
    u
event.fireubeacons_refreshu2Event module not available. Module refresh failed.(R:RR/R0R9(R2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyRJ�s



cC@sBytdid�}Wn$tk
r=tjd�t}nX|S(u�
    Signal the minion to refresh its matchers.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.refresh_matchers
    u
event.fireumatchers_refreshu3Event module not available. Matcher refresh failed.(R:RR/R0R9(R2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytrefresh_matchers�s



icC@s�ytdid�}Wn$tk
r=tjd�t}nX|r�tjjjddt	dt
�}|jddd	|�}|s�|d
tkr�tjd|�q�n|S(u
    Signal the minion to refresh the pillar data.

    :param wait:            Wait for pillar refresh to complete, defaults to False.
    :type wait:             bool, optional
    :param timeout:         How long to wait in seconds, only used when wait is True, defaults to 30.
    :type timeout:          int, optional
    :return:                Boolean status, True when the pillar_refresh event was fired successfully.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.refresh_pillar
    u
event.fireupillar_refreshu2Event module not available. Module refresh failed.uminiontoptstlistenttagu+/salt/minion/minion_pillar_refresh_completetwaitucompleteu1Pillar refresh did not complete within timeout %s(R:RR/R0R9R
R#teventt	get_eventRRTtwarn(RwttimeoutR2teventert	event_ret((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyRVs


!		upillar_refreshcK@s�t|jdt��}y~|r7tdid�}n^tjjjddtdt�}tditd6d�}t	j
d�|jd	d
dd�Wn$tk
r�t	jd
�t
}nX|S(u#
    Signal the minion to refresh the module and grain data

    The default is to refresh module asynchronously. To block
    until the module refresh is complete, set the 'async' flag
    to False.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.refresh_modules
    uasyncu
event.fireumodule_refreshuminionRtRuunotifyu6refresh_modules waiting for module refresh to completeRvu /salt/minion/minion_mod_completeRwiu2Event module not available. Module refresh failed.(tboolR+RTR:R
R#RxRyRR/ttraceRR0R9(RWtasynchronousR2R|((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyRN(s!



cC@sRt�}g}x<|D]4}tj|jdd�|�r|j|�qqW|S(u�
    If the named function is running return the data associated with it/them.
    The argument can be a glob

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.is_running state.highstate
    ufunu(trunningtfnmatchR+tappend(tfuntrunR2tdata((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
is_runningHs	
cC@stjjjt�S(u�
    Return the data on all running salt processes on the minion

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.running
    (R
R#tminionR�R(((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyR�[s
cC@s�x�tjjjtddt�D]g\}}}xU|D]M}y tjtjj	||��Wq6t
k
r�}tjd|�tSXq6Wq Wt
S(u6
    Forcibly removes all caches on a minion.

    .. versionadded:: 2014.7.0

    WARNING: The safest way to clear a minion cache is by first stopping
    the minion and then deleting the cache files before restarting it.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.clear_cache
    ucachedirtfollowlinksu@Attempt to clear cache with saltutil.clear_cache FAILED with: %s(R
R#R)t	safe_walkRR9R&R-R'R(R.R/R0RT(troottdirsR)tnameR((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytclear_cachehs/
 
ic	C@s�tj�|d}x�tjjjtjjtdd�dt	�D]�\}}}x||D]t}yGtjj||�}tjj
|�}||kr�tj|�nWqYt
k
r�}tjd|�t	SXqYWqCWtS(uT
    Forcibly removes job cache folders and files on a minion.

    .. versionadded:: 2018.3.0

    WARNING: The safest way to clear a minion cache is by first stopping
    the minion and then deleting the cache files before restarting it.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.clear_job_cache hours=12
    iucachediruminion_jobsR�uDAttempt to clear cache with saltutil.clear_job_cache FAILED with: %s(ttimeR
R#R)R�R&R'R(RR9tgetmtimetshutiltrmtreeR.R/R0RT(	thourst	thresholdR�R�R)R�t	directorytmtimeR((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytclear_job_cache�s(

cC@s,x%t�D]}|d|kr
|Sq
WiS(um
    Return the data for a specific job id that is currently running.

    jid
        The job id to search for and return data.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.find_job <job id>

    Note that the find_job function only returns job information when the job is still running. If
    the job is currently running, the output looks something like this:

    .. code-block:: bash

        # salt my-minion saltutil.find_job 20160503150049487736
        my-minion:
            ----------
            arg:
                - 30
            fun:
                test.sleep
            jid:
                20160503150049487736
            pid:
                9601
            ret:
            tgt:
                my-minion
            tgt_type:
                glob
            user:
                root

    If the job has already completed, the job cannot be found and therefore the function returns
    an empty dictionary, which looks like this on the CLI:

    .. code-block:: bash

        # salt my-minion saltutil.find_job 20160503150049487736
        my-minion:
            ----------
    ujid(R�(tjidR�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytfind_job�s.cC@stjjt�}tjjtdd�}tjj|tj|��}tjj	|�s~tj
d�sndSdj|�Sntjj|d�}tjj
j|d��}|j�}WdQX|ry|j|�}Wntk
r�qXt|t�r|SndS(	u�
    Return the data for a specific cached job id. Note this only works if
    cache_jobs has previously been set to True on the minion.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.find_cached_job <job id>
    ucachediruminion_jobsu
cache_jobsuVLocal jobs cache directory not found; you may need to enable cache_jobs on this minionu(Local jobs cache directory {0} not foundureturn.purbN(R
tpayloadtSerialRR&R'R(Rt	text_typetisdirR+RR#R)R*treadtloadst	NameErrorR tdictR(R�tserialtproc_dirtjob_dirR'tfp_tbufR�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytfind_cached_job�s$
cC@svttkrtjd�nxSt�D]H}|d|kr&y�tr�x@tjjjd|d�j	dt
�D]}|j|�qnWntj
t|d�|�ttkr�d|kr�x+|dD]}tj
t|�|�q�Wndjt|�||d�SWqntk
rjtjjtdd	tj|��}tjj|�r]tj|�nd
j|�SXq&q&WdS(u�
    Sends a signal to the named salt job's process

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.signal_job <job id> 15
    u|saltutil.signal job called, but psutil is not installed. Install psutil to ensure more reliable and accurate PID management.ujidtpidupidt	recursiveu
child_pidsu%Signal {0} sent to job {1} at pid {2}ucachediruprocu9Job {0} was not running and job data has been  cleaned upu(t
HAS_PSUTILR9R/twarningR�R
R#t
psutil_compattProcesstchildrenRTtsend_signalR&tkilltintRR.R'R(RRR�R,R-(R�tsigR�tprocR�R'((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
signal_job�s.
/	
%cC@st|tj�S(u�
    Sends a termination signal (SIGTERM 15) to the named salt job's process

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.term_job <job id>
    (R�tsignaltSIGTERM(R�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytterm_job s
cC@s;g}x.t�D]#}|jt|dtj��qW|S(u�
    Sends a termination signal (SIGTERM 15) to all currently running jobs

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.term_all_jobs
    ujid(R�R�R�R�R�(R2R�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
term_all_jobs-s
!cC@s
t|t�S(u�
    Sends a kill signal (SIGKILL 9) to the named salt job's process

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.kill_job <job id>
    (R�tsalt_SIGKILL(R�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytkill_job=scC@s8g}x+t�D] }|jt|dt��qW|S(u�
    Sends a kill signal (SIGKILL 9) to all currently running jobs

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.kill_all_jobs
    ujid(R�R�R�R�(R2R�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
kill_all_jobsLscC@s�x\tjtd�D]G}tjjtd|�}ytj|�Wqtjk
rZqXqWtjj	j
jt�}|j�dS(u
    Used to regenerate the minion keys.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.regen_keys
    upki_dirN(
R&ReRR'R(R-R0R
t	transporttclientt
ReqChanneltfactorytclose(tfn_R'tchannel((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt
regen_keys^s
cC@s�t�}t}dtkr@x3tdD]}|j|�q&Wn|jtd�x�|D]�}tjjjjtd|�}|j	j
d�}idd6tdd6|d6|d	6}z/y|j|�Wntk
r�t
}nXWd
|j�XqXW|S(u�
    The minion sends a request to the master to revoke its own key.
    Note that the minion session will be revoked and the minion may
    not be able to return the result of this command back to the master.

    If the 'preserve_minion_cache' flag is set to True, the master
    cache for this minion will not be removed.

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.revoke_auth
    umaster_uri_listu
master_urit
master_uriR
urevoke_authucmduidutokupreserve_minion_cacheN(RRTRR�R
R�R�R�R�tautht	gen_tokentsendRR9R�(tpreserve_minion_cachetmastersR2R�tmasterR�ttoktload((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytrevoke_authts(	



cC@s7|r!tjjjj|�}ntjj|�}|S(N(R
R�tssht	SSHClienttget_local_client(tcfgfileR�R�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt_get_ssh_or_api_client�scK@shi}	d}
d|krf|j}i|d6|d6|d6|d6|d6|d6|dd6}|d=n�d	|kr�|j}i|d6|d6|d6|d6|d6td
6|d6|d	d6}|d	=n@|j}i|d6|d6|d6|d6|d6|d6|d6}|j|�xM||�D]?}
|	j|
�|
d
7}
|dkr!t|�|
kr!Pq!q!W|	S(Niubatchutgtufunuargutgt_typeuretukwargusubsetucliusubutimeoutiulist(t	cmd_batcht
cmd_subsetRTtcmd_iterRItlen(R�ttgtR�targR{ttgt_typeR2tkwargRWtfcn_rettseent_cmdt
cmd_kwargstret_comp((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt_exec�s2	
	#
	


uglobucK@s6td}	t|	|�}
t|
||||||||�}dj|	d �}|r�|	jdjtjjd��r�tjj|�r�t||�}
t|
||||||||�}nd|kr2|i}
}xV|
j	�D]E\}}it
|t�r|jdd�ndd6|d	6||<q�Wn|S(
u%
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Assuming this minion is a master, execute a salt command

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.cmd
    u	conf_fileu	{0}masteri����u{0}{1}uminionubatchuoutu	highstateuret(
RR�R�RtendswithR&R'tseptexiststitemsR R�R+(R�R�R�R{R�R2R�R�RWR�R�R�tmaster_cfgfiletold_rettkeytvalue((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytcmd�s$
!!$
(c
	k@ss|r%tjjjjtd�}	ntjjtd�}	x1|	j||||||||�D]}|Vq`WdS(u*
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Assuming this minion is a master, execute a salt command

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.cmd_iter
    u	conf_fileN(R
R�R�R�RR�R�(
R�R�R�R{R�R2R�R�RWR�((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyR��s	
ubasec
K@s�|dkrg}n|dkr*i}n|jd|�}|jd|�}tjjj|�}|ry|j|�ndtkr�tj	j
tj	jtd�d�}tjj
|�}tjj|�}	ntjjt�}	||	jkr-tjjj|	j|�}
d|
jkr-||d<q-n|dkrF||d
<n|r�tjjjt|idd6|d
6|d6|d6dd�n|	j|d|d|dtd|�S(u[
    Execute a runner function. This function must be run on the master,
    either by targeting a minion running on a master or by using
    salt-call on a master.

    .. versionadded:: 2014.7.0

    name
        The name of the function to run

    kwargs
        Any keyword arguments to pass to the runner function

    CLI Example:

    In this example, assume that `master_minion` is a minion running
    on a master.

    .. code-block:: bash

        salt master_minion saltutil.runner jobs.list_jobs
        salt master_minion saltutil.runner test.arg arg="['baz']" kwarg="{'foo': 'bar'}"
    u__orchestration_jid__u__env__umaster_job_cacheu	conf_fileumasterusaltenvustate.orchestrateu
state.orchu	state.slsuorchestration_jidurunnerutypeunameuargsukwargstprefixurunR�R�tprint_eventtfull_returnN(ustate.orchestrateu
state.orchu	state.sls(RRSR
R#RQRRRIRR&R'R(tdirnametconfigt
master_configtrunnertRunnerClientt	functionstget_function_argspecRxt	fire_argsR�R9(R�R�R�R�RR�RWR�tmaster_optstrclienttaspec((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyR�s@			
"
cO@s�|jdd�}|jdd�}tddkr�tjjtjjtd�d�}tjj	|�}tj
j|�}ntj
jt�}i}i}	xCtj
|�D]2\}
}|
jd�r�|||
<q�||	|
<q�Wy�||jkr1tjjj|j|�}d	|jkr1||	d	<q1n|rntjjjt|id
d6|d6|	d
6dd�n|j|d|d|d|	dtdt�}
Wntk
r�td��nX|
S(u�
    Execute a wheel module and function. This function must be run against a
    minion that is local to the master.

    .. versionadded:: 2014.7.0

    name
        The name of the function to run

    args
        Any positional arguments to pass to the wheel function. A common example
        of this would be the ``match`` arg needed for key functions.

        .. versionadded:: v2015.8.11

    kwargs
        Any keyword arguments to pass to the wheel function

    CLI Example:

    .. code-block:: bash

        salt my-local-minion saltutil.wheel key.accept jerry
        salt my-local-minion saltutil.wheel minions.connected

    .. note::

        Since this function must be run against a minion that is running locally
        on the master in order to get accurate returns, if this function is run
        against minions that are not local to the master, "empty" returns are
        expected. The remote minion does not have access to wheel functions and
        their return data.

    u__orchestration_jid__u__env__ubaseu__roleuminionu	conf_fileumasteru__usaltenvuwheelutypeunameuargsR�urunR�tpub_dataR�R�R�uLThis command can only be executed on a minion that is located on the master.N(RSRRR&R'R(R�R
R�t
client_configtwheeltWheelClientRt	iteritemst
startswithR�R#RQR�RxR�R�R9RTR	R(R�RQRWR�RR�R�twheel_clientR�tvalid_kwargsR�tvalR�R2((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyR�_sH#	




t_MMinioncB@seZed�ZRS(cC@s�dt�krian|tks*|r�tjt�}|d=tjt�}tjj|�}|a||j	d<|j	d|}g|D]}|d^q�|j	d<|j
�|t|<nt|S(Nu	_mminionsu
file_rootsugrainsu	/_modulesumodule_dirs(tglobalst	_mminionstcopytdeepcopyRR>R
R�tMasterMinionRttgen_modules(tclsRt
reload_envRttgrainstmt	env_rootstfp((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt__new__�s	
$

(t__name__t
__module__R9R(((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyR�scO@s t|�}|j|||�S(u�
    Loads minion modules from an environment so that they can be used in pillars
    for that environment

    CLI Example:

    .. code-block:: bash

        salt '*' saltutil.mmodule base test.ping
    (RR�(RR�RQRWtmminion((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pytmmodule�s(((ot__doc__t
__future__RRRRR�tloggingR&R�R8R�R�R;RRTR6tImportErrorR9tsalt.extRtsalt.ext.six.moves.urllib.errorRtSIGKILLR�tAttributeErrorR�R
tsalt.configtsalt.clienttsalt.client.ssh.clienttsalt.payloadtsalt.runnert
salt.statetsalt.utils.argstsalt.utils.eventtsalt.utils.extmodstsalt.utils.filestsalt.utils.functoolstsalt.utils.miniontsalt.utils.pathtsalt.utils.processtsalt.utils.urlt
salt.wheeltsalt.transport.clientR�tsalt.utils.psutil_compattsalt.exceptionsRRRR	t__proxyenabled__t	getLoggerRR/RRR5RIRLRMRORPRYRZR[R\R]R^R_R`RaR#t	functoolstalias_functiontsync_outputtersRbRcRdRnRoRpRrRJRsRVtpillar_refreshRNR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tobjectRR(((s9/usr/lib/python2.7/site-packages/salt/modules/saltutil.pyt<module>s�







"		B'$8'	!)(&'&&&%#''	')I			 		
		4	$	&	
				'	%-A	Y

Zerion Mini Shell 1.0