%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@sudZddlmZmZmZddlZddlZddlm	Z	ej
e�ZdZ
d�Zd�ZdS(u7
Display return data in JSON format
==================================

:configuration: The output format can be configured in two ways:
    Using the ``--out-indent`` CLI flag and specifying a positive integer or a
    negative integer to group JSON from each minion to a single line.

    Or setting the ``output_indent`` setting in the Master or Minion
    configuration file with one of the following values:

    * ``Null``: put each minion return on a single line.
    * ``pretty``: use four-space indents and sort the keys.
    * An integer: specify the indentation level.

Salt's outputters operate on a per-minion basis. Each minion return will be
output as a single JSON object once it comes in to the master.

Some JSON parsers can guess when an object ends and a new one begins but many
can not. A good way to differentiate between each minion return is to use the
single-line output format and to parse each line individually. Example output
(truncated)::

    {"dave": {"en0": {"hwaddr": "02:b0:26:32:4c:69", ...}}}
    {"jerry": {"en0": {"hwaddr": "02:26:ab:0d:b9:0d", ...}}}
    {"kevin": {"en0": {"hwaddr": "02:6d:7f:ce:9f:ee", ...}}}
    {"mike": {"en0": {"hwaddr": "02:48:a2:4b:70:a0", ...}}}
    {"phill": {"en0": {"hwaddr": "02:1d:cc:a2:33:55", ...}}}
    {"stuart": {"en0": {"hwaddr": "02:9a:e0:ea:9e:3c", ...}}}
i(tabsolute_importtprint_functiontunicode_literalsN(tsixujsoncC@stS(u
    Rename to json
    (t__virtualname__(((s8/usr/lib/python2.7/site-packages/salt/output/json_out.pyt__virtual__1scK@sFy�dtkr.tjjj|dtdd�Stjd�}t}|d
krXd
}nH|dkrsd}t	}n-t
|t�r�|dkr�|}q�d
}ntjjj|dtd|d|�SWnjtk
r}t
jd�tjjjidd	6tj|�d
6�Stk
r2t
jddt	�nXtjjji�S(u'
    Print the output data in JSON
    u
output_indenttdefaulttindentiuprettyit	sort_keysu"Unable to serialize output to jsonuerrorumessageu'An error occurred while outputting JSONtexc_infoN(t__opts__tsalttutilstjsontdumpstreprtgettFalsetNonetTruet
isinstancetinttUnicodeDecodeErrortlogterrorRt	text_typet	TypeErrortdebug(tdatatkwargsRRtexc((s8/usr/lib/python2.7/site-packages/salt/output/json_out.pytoutput8s.				)


(t__doc__t
__future__RRRtloggingtsalt.utils.jsonRtsalt.extRt	getLoggert__name__RRRR(((s8/usr/lib/python2.7/site-packages/salt/output/json_out.pyt<module>s	

Zerion Mini Shell 1.0