%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/fileserver/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/fileserver/gitfs.pyc

�
���^c@@s dZddlmZmZmZddlZd-Zd.Zd/Zd0Z	ddl
Zddlm
Z
eje�ZdZed�Zd�Zd�Zddd �Zdd!�Zdd"�Zd#�Zed$�Zdd%�Zd&�Zd'�Zd(�Z d)�Z!d*�Z"d+�Z#d,�Z$dS(1u
Git Fileserver Backend

With this backend, branches and tags in a remote git repository are exposed to
salt as different environments.

To enable, add ``gitfs`` to the :conf_master:`fileserver_backend` option in the
Master config file.

.. code-block:: yaml

    fileserver_backend:
      - gitfs

.. note::
    ``git`` also works here. Prior to the 2018.3.0 release, *only* ``git``
    would work.

The Git fileserver backend supports both pygit2_ and GitPython_, to provide the
Python interface to git. If both are present, the order of preference for which
one will be chosen is the same as the order in which they were listed: pygit2,
then GitPython.

An optional master config parameter (:conf_master:`gitfs_provider`) can be used
to specify which provider should be used, in the event that compatible versions
of both pygit2_ and GitPython_ are installed.

More detailed information on how to use GitFS can be found in the :ref:`GitFS
Walkthrough <tutorial-gitfs>`.

.. note:: Minimum requirements

    To use pygit2_ for GitFS requires a minimum pygit2_ version of 0.20.3.
    pygit2_ 0.20.3 requires libgit2_ 0.20.0. pygit2_ and libgit2_ are developed
    alongside one another, so it is recommended to keep them both at the same
    major release to avoid unexpected behavior. For example, pygit2_ 0.21.x
    requires libgit2_ 0.21.x, pygit2_ 0.22.x will require libgit2_ 0.22.x, etc.

    To use GitPython_ for GitFS requires a minimum GitPython version of 0.3.0,
    as well as the git CLI utility. Instructions for installing GitPython can
    be found :ref:`here <gitfs-dependencies>`.

    To clear stale refs the git CLI utility must also be installed.

.. _pygit2: https://github.com/libgit2/pygit2
.. _libgit2: https://libgit2.github.com/
.. _GitPython: https://github.com/gitpython-developers/GitPython
i(tabsolute_importtprint_functiontunicode_literalsNubaseu
mountpointurootu
ssl_verifyusaltenv_whitelistusaltenv_blacklistu
env_whitelistu
env_blacklisturefspecsudisable_saltenv_mappingu	ref_typesuupdate_intervaluall_saltenvsunameusaltenvupygit2uuserupasswordupubkeyuprivkeyu
passphraseu
insecure_auth(tFileserverConfigErrorugitfsc	C@s,tjjjttddtdtd|�S(Nu
gitfs_remotestper_remote_overridestper_remote_onlytinit_remotes(tsalttutilstgitfstGitFSt__opts__tPER_REMOTE_OVERRIDEStPER_REMOTE_ONLY(R((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyt_gitfsNs
cC@sAttdkrtSytdt�tSWntk
r<nXtS(uz
    Only load if the desired provider module is present and gitfs is enabled
    properly in the master config file.
    ufileserver_backendR(t__virtualname__RtFalseRR(((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyt__virtual__Ws

cC@stdt�j�S(u&
    Completely clear gitfs cache
    R(RRtclear_cache(((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyRhsuupdatecC@st�jd|d|�S(u
    Clear update.lk
    tremotet	lock_type(Rt
clear_lock(RR((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyRoscC@st�jd|�S(u�
    Place an update.lk

    ``remote`` can either be a dictionary containing repo configuration
    information, or a pattern. If the latter, then remotes for which the URL
    matches the pattern will be locked.
    R(Rtlock(R((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyRvscC@st�j|�dS(u1
    Execute a git fetch on all of the repos
    N(Rtupdate(tremotes((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR�scC@s
t�j�S(uA
    Returns the update intervals for each configured remote
    (Rtupdate_intervals(((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR�scC@st�jd|�S(u@
    Return a list of refs that can be used as environments
    tignore_cache(Rtenvs(R((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR�scK@st�j|d||�S(u�
    Find the first file to match the path and ref, read the file out of git
    and send the path to the newly cached file
    ttgt_env(Rt	find_file(tpathRtkwargs((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR�scC@st�dS(us
    Initialize remotes. This is only used by the master's pre-flight checks,
    and is not invoked by GitFS.
    N(R(((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pytinit�scC@st�j||�S(u?
    Return a chunk from a file based on the data received
    (Rt
serve_file(tloadtfnd((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR!�scC@st�j||�S(uL
    Return a file hash, the hash type is set in the master config file
    (Rt	file_hash(R"R#((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR$�scC@st�j|�S(u�
    Return a list of all files on the file server in a specified
    environment (specified as a key within the load dict).
    (Rt	file_list(R"((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR%�scC@sgS(u>
    Return a list of all empty directories on the master
    ((R"((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pytfile_list_emptydirs�scC@st�j|�S(u8
    Return a list of all directories on the master
    (Rtdir_list(R"((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR'�scC@st�j|�S(uI
    Return a dict of all symlinks based on a given path in the repo
    (Rtsymlink_list(R"((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyR(�s(ubaseu
mountpointurootu
ssl_verifyusaltenv_whitelistusaltenv_blacklistu
env_whitelistu
env_blacklisturefspecsudisable_saltenv_mappingu	ref_typesuupdate_interval(uall_saltenvsunameusaltenv(upygit2(uuserupasswordupubkeyuprivkeyu
passphraseu
insecure_auth(%t__doc__t
__future__RRRtloggingRR
tAUTH_PROVIDERStAUTH_PARAMStsalt.utils.gitfsRtsalt.exceptionsRt	getLoggert__name__tlogRtTrueRRRtNoneRRRRRRRR R!R$R%R&R'R((((s9/usr/lib/python2.7/site-packages/salt/fileserver/gitfs.pyt<module>1s<										

Zerion Mini Shell 1.0