%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/runners/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/runners/cache.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	ddl
mZddlZ	ddl
Z	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlmZddlmZeje�Zidd6Zdd	d
�Zdd	d�Z dd	d�Z!dd	e"e"e"dd
�Z#dd	d�Z$dd	d�Z%dd	d�Z&dd	dd�Z'dd	d�Z(dd�Z)dd�Z*dd�Z+dd�Z,dd�Z-ddd�Z.dS(u!
Return cached data from minions
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tSaltInvocationError(t
clear_lockulistulist_uglobc	K@s_|dkr%tjjjdd�ntjjj||dtdtdt	�}|j
�}|S(u�
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached grains of the targeted minions.

    tgt
        Target to match minion ids.

        .. versionchanged:: 2017.7.5,2018.3.0
            The ``tgt`` argument is now required to display cached grains. If
            not used, the function will not return grains. This optional
            argument will become mandatory in the Salt ``Sodium`` release.

    tgt_type
        The type of targeting to use for matching, such as ``glob``, ``list``,
        etc.

    CLI Example:

    .. code-block:: bash

        salt-run cache.grains '*'
    uSodiumu�Detected missing 'tgt' option. Cached grains will not be returned without a specified 'tgt'. This option will be required starting in Salt Sodium and this warning will be removed.tuse_cached_grainstgrains_fallbacktoptsN(tNonetsalttutilstversionst
warn_untiltmastertMasterPillarUtiltTruetFalset__opts__tget_minion_grains(ttgtttgt_typetkwargstpillar_utilt
cached_grains((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytgrains!s
	c
K@sFtjjj||dtdtdtdtdt�}|j�}|S(u
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached pillars of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.pillar
    RRtuse_cached_pillartpillar_fallbackR(R
RRRRRRtget_minion_pillar(RRRRt
cached_pillar((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytpillarMs	c
K@sFtjjj||dtdtdtdtdt�}|j�}|S(u
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Return cached mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.mine
    RRRRR(R
RRRRRtget_cached_mine_data(RRRRtcached_mine((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytminees	c
C@sh|d
krtStjjj||dtdtdtdtdt�}|jd|d|d|d	|�S(u?
    Clear the cached data/files for the targeted minions.
    RRRRRtclear_pillartclear_grainst
clear_minetclear_mine_funcN(	R	RR
RRRRRtclear_cached_minion_data(RRtclear_pillar_flagtclear_grains_flagtclear_mine_flagtclear_mine_func_flagR((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyt_clear_cache}s		cC@st||dt�S(u'
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached pillar data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_pillar
    R'(R+R(RR((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyR"�scC@st||dt�S(u'
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached grains data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_grains
    R((R+R(RR((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyR#�scC@st||dt�S(u#
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_mine
    R)(R+R(RR((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyR$�scC@st||d|�S(uc
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached mine function data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_mine_func tgt='*' clear_mine_func_flag='network.interfaces'
    R*(R+(RRR*((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyR%�sc	C@st||dtdtdt�S(u6
    .. versionchanged:: 2017.7.0
        The ``expr_form`` argument has been renamed to ``tgt_type``, earlier
        releases must use ``expr_form``.

    Clear the cached pillar, grains, and mine data of the targeted minions

    CLI Example:

    .. code-block:: bash

        salt-run cache.clear_all
    R'R(R)(R+R(RR((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyt	clear_all�s
cK@s�tjjj|�}tjjj|jddddg��}|r[tjjj|�n|dkr�tjjjt	t	ddtj
jjdtj
jj�g}n�|d	krag}xlt	d
D]�}t
t|��}|dkr�t|dt�sq�ntjjjt	|ddtjjjdtjjjdtjjj�}|j|�q�q�Wn�|d
krt	d}t	d}	g}x�|	|ft	dt	dffD]d\}
}tjjjt	|
dtjjjdtjjjdtjjjd|�}|j|�q�Wntdj|���i}x�|D]}xv|D]n}
t|j|d|d|
�\}}|r�|jdg�j|�n|rB|jdg�j|�qBqBWq5W|s�dS|S(u�
    .. versionadded:: 2015.8.2

    Remove the update locks for Salt components (gitfs, git_pillar, winrepo)
    which use gitfs backend code from salt.utils.gitfs.

    .. note::
        Running :py:func:`cache.clear_all <salt.runners.cache.clear_all>` will
        not include this function as it does for pillar, grains, and mine.

        Additionally, executing this function with a ``role`` of ``gitfs`` is
        equivalent to running ``salt-run fileserver.clear_lock backend=git``.

    role
        Which type of lock to remove (``gitfs``, ``git_pillar``, or
        ``winrepo``)

    remote
        If specified, then any remotes which contain the passed string will
        have their lock cleared. For example, a ``remote`` value of **github**
        will remove the lock from all github.com remotes.

    type : update,checkout,mountpoint
        The types of lock to clear. Can be one or more of ``update``,
        ``checkout``, and ``mountpoint``, and can be passed either as a
        comma-separated or Python list.

        .. versionadded:: 2015.8.8
        .. versionchanged:: 2018.3.0
            ``mountpoint`` lock type added

    CLI Examples:

    .. code-block:: bash

        salt-run cache.clear_git_lock gitfs
        salt-run cache.clear_git_lock git_pillar
        salt-run cache.clear_git_lock git_pillar type=update
        salt-run cache.clear_git_lock git_pillar type=update,checkout
        salt-run cache.clear_git_lock git_pillar type='["update", "mountpoint"]'
    utypeuupdateucheckoutu
mountpointugitfsu
gitfs_remotestper_remote_overridestper_remote_onlyu
git_pillaru
ext_pillarugittglobal_onlyuwinrepouwinrepo_diruwinrepo_remotesuwinrepo_remotes_nguwinrepo_dir_ngt
cache_rootuInvalid role '{0}'tremotet	lock_typeucleareduerrorsuNo locks were removed(R
Rtargstclean_kwargstsplit_inputtpoptinvalid_kwargstgitfstGitFSRt
fileservertPER_REMOTE_OVERRIDEStPER_REMOTE_ONLYtnexttitert
isinstancetlistt	GitPillarRt
git_pillartGLOBAL_ONLYtappendtWinRepotrunnerstwinrepoRtformatt_clear_lockRt
setdefaulttextend(troleR1Rttype_tgit_objectst
ext_pillartkeytobjtwinrepo_dirtwinrepo_remotestremotestbase_dirtretR2tclearedterrors((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytclear_git_lock�sn*



	!	

	$c
C@st|tj�siStjjtjjtjj	t
d�d��}|jd�sZiStdd|d|�}|dkr�iSi}x�tj|�D]y\}}xjtj|�D]Y\}}xJtj|�D]9\}}	tj||�r�|	||<|||d<q�q�Wq�Wq�W|S(	uA
    Return cloud cache data for target.

    .. note:: Only works with glob matching

    tgt
      Glob Target to match minion ids

    provider
      Cloud Provider

    CLI Example:

    .. code-block:: bash

        salt-run cache.cloud 'salt*'
        salt-run cache.cloud glance.example.org provider=openstack
    u	conf_fileuclouduupdate_cachedirucloud.list_cache_nodes_fullRtprovideruproviderN(R?Rtstring_typesR
tconfigtcloud_configtostpathtjointdirnameRtgett	__utils__R	t	iteritemstfnmatch(
RRZRtcloud_cacheRVtdrivert	providerstserverstnametdata((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytcloudZs"	(
cC@sn|dkrtd}nytjjtd|�}Wn#tk
rZtjjt�}nX|j|||�S(u�
    Lists entries stored in the specified bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.store mycache mykey 'The time has come the walrus said'
    ucachedirtcachedirN(R	RR
tcachetCachet	TypeErrortstore(tbankRPRkRmRn((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyRq�s


cC@sh|dkrtd}nytjjtd|�}Wn#tk
rZtjjt�}nX|j|�S(u�
    Lists entries stored in the specified bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.list cloud/active/ec2/myec2 cachedir=/var/cache/salt/
    ucachedirRmN(R	RR
RnRoRpR@(RrRmRn((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pytlist_�s


cC@sk|dkrtd}nytjjtd|�}Wn#tk
rZtjjt�}nX|j||�S(u�
    Fetch data from a salt.cache bank.

    CLI Example:

    .. code-block:: bash

        salt-run cache.fetch cloud/active/ec2/myec2 myminion cachedir=/var/cache/salt/
    ucachedirRmN(R	RR
RnRoRptfetch(RrRPRmRn((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyRt�s


cC@sk|dkrtd}nytjjtd|�}Wn#tk
rZtjjt�}nX|j||�S(uo
    Remove the key from the cache bank with all the key content. If no key is
    specified remove the entire bank with all keys and sub-banks inside.

    CLI Examples:

    .. code-block:: bash

        salt-run cache.flush cloud/active/ec2/myec2 cachedir=/var/cache/salt/
        salt-run cache.flush cloud/active/ec2/myec2 myminion cachedir=/var/cache/salt/
    ucachedirRmN(R	RR
RnRoRptflush(RrRPRmRn((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyRu�s

(/t__doc__t
__future__RRRRetloggingR^tsalt.configR
tsalt.extRtsalt.logtsalt.utils.argstsalt.utils.gitfstsalt.utils.mastertsalt.payloadt
salt.cachetsalt.fileserver.gitfstsalt.pillar.git_pillartsalt.runners.winrepotsalt.exceptionsRtsalt.fileserverRRIt	getLoggert__name__tlogt__func_alias__R	RRR!RR+R"R#R$R%R,RYRlRqRsRtRu(((s6/usr/lib/python2.7/site-packages/salt/runners/cache.pyt<module>sT
,k*

Zerion Mini Shell 1.0