%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/runners/ |
Current File : //usr/lib/python2.7/site-packages/salt/runners/salt.pyc |
� ���^c @@ s� 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 Z d d l Z d d l Z d d l m Z e j e � Z d � Z d d d d d d d � Z d S( u� This runner makes Salt's execution modules available on the salt master. .. versionadded:: 2016.11.0 .. _salt_salt_runner: Salt's execution modules are normally available on the salt minion. Use this runner to call execution modules on the salt master. Salt :ref:`execution modules <writing-execution-modules>` are the functions called by the ``salt`` command. Execution modules can be called with ``salt-run``: .. code-block:: bash salt-run salt.cmd test.ping # call functions with arguments and keyword arguments salt-run salt.cmd test.arg 1 2 3 key=value a=1 Execution modules are also available to salt runners: .. code-block:: python __salt__['salt.cmd'](fun=fun, args=args, kwargs=kwargs) i ( t absolute_importt print_functiont unicode_literalsN( t SaltClientErrorc O@ s t j d | � t j j j | � } | j d t � } t j t � } t j j | � | d <| r� t j j | | d | d d | d d | j d � �j � | d <n i | d <t j j | d t j j | � d t �} | | k r� | | | | � Sd j | � S( u� .. versionchanged:: 2018.3.0 Added ``with_pillar`` argument Execute ``fun`` with the given ``args`` and ``kwargs``. Parameter ``fun`` should be the string :ref:`name <all-salt.modules>` of the execution module to call. .. note:: Execution modules will be loaded *every time* this function is called. Additionally, keep in mind that since runners execute on the master, custom execution modules will need to be synced to the master using :py:func:`salt-run saltutil.sync_modules <salt.runners.saltutil.sync_modules>`, otherwise they will not be available. with_pillar : False If ``True``, pillar data will be compiled for the master .. note:: To target the master in the pillar top file, keep in mind that the default ``id`` for the master is ``<hostname>_master``. This can be overridden by setting an ``id`` configuration parameter in the master config file. CLI example: .. code-block:: bash salt-run salt.cmd test.ping # call functions with arguments and keyword arguments salt-run salt.cmd test.arg 1 2 3 a=1 salt-run salt.cmd mymod.myfunc with_pillar=True u. Called salt.cmd runner with minion function %su with_pillaru grainsu idt saltenvu saltenvt pillarenvu pillarenvu pillart utilst contextu '{0}' is not available.( t logt debugt saltR t argst clean_kwargst popt Falset copyt deepcopyt __opts__t loadert grainst pillart get_pillart gett compile_pillart minion_modst __context__t format( t funR t kwargst with_pillart optst functions( ( s5 /usr/lib/python2.7/site-packages/salt/runners/salt.pyt cmd/ s&