%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/runners/ |
Current File : //lib/python2.7/site-packages/salt/runners/git_pillar.pyo |
� ���^c @@ sx d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m Z e j e � Z d d d � Z d S( u: Runner module to directly manage the git external pillar i ( t absolute_importt print_functiont unicode_literalsN( t SaltRunnerErrorc C@ s� i } xSt j d g � D]?} t t | � � } | d k rC q n | | } t j j j t | d t j j j d t j j j d t j j j �} x� | j D]� } | d k r� | | j k r� q� q� n | d k r� | | j k r� q� q� n zO y | j � } Wn8 t k r7} t j d | | j d t j �t } n XWd | j � X| | | j <q� Wq W| s�| d k sz| d k r�t d � � q�t d � � n | S( u� .. versionadded:: 2014.1.0 .. versionchanged:: 2015.8.4 This runner function now supports the :ref:`git_pillar configuration schema <git-pillar-configuration>` introduced in 2015.8.0. Additionally, the branch and repo can now be omitted to update all git_pillar remotes. The return data has also changed to a dictionary. The values will be ``True`` only if new commits were fetched, and ``False`` if there were errors or no new commits were fetched. .. versionchanged:: 2018.3.0 The return for a given git_pillar remote will now be ``None`` when no changes were fetched. ``False`` now is reserved only for instances in which there were errors. Fetch one or all configured git_pillar remotes. .. note:: This will *not* fast-forward the git_pillar cachedir on the master. All it does is perform a ``git fetch``. If this runner is executed with ``-l debug``, you may see a log message that says that the repo is up-to-date. Keep in mind that Salt automatically fetches git_pillar repos roughly every 60 seconds (or whatever :conf_master:`loop_interval` is set to). So, it is possible that the repo was fetched automatically in the time between when changes were pushed to the repo, and when this runner was executed. When in doubt, simply refresh pillar data using :py:func:`saltutil.refresh_pillar <salt.modules.saltutil.refresh_pillar>` and then use :py:func:`pillar.item <salt.modules.pillar.item>` to check if the pillar data has changed as expected. CLI Example: .. code-block:: bash # Update specific branch and repo salt-run git_pillar.update branch='branch' repo='https://foo.com/bar.git' # Update all repos salt-run git_pillar.update # Run with debug logging salt-run git_pillar.update -l debug u ext_pillaru gitt per_remote_overridest per_remote_onlyt global_onlyu; Exception '%s' caught while fetching git_pillar remote '%s't exc_info_on_loglevelNu8 Specified git branch/repo not found in ext_pillar configu$ No git_pillar remotes are configured( t __opts__t gett nextt itert saltt utilst gitfst GitPillart pillart git_pillart PER_REMOTE_OVERRIDESt PER_REMOTE_ONLYt GLOBAL_ONLYt remotest Nonet brancht urlt fetcht Exceptiont logt errort idt loggingt DEBUGt Falset clear_lockR ( R t repot rett ext_pillart pillar_typet pillar_confR t remotet resultt exc( ( s; /usr/lib/python2.7/site-packages/salt/runners/git_pillar.pyt update sH - ( t __doc__t __future__R R R R t salt.pillar.git_pillarR t salt.utils.gitfst salt.exceptionsR t getLoggert __name__R R R* ( ( ( s; /usr/lib/python2.7/site-packages/salt/runners/git_pillar.pyt <module> s