File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/output/__pycache__/newline_values_only.cpython-310.pyc
Back
o ;jp � @ s( d Z dd� Zdd� Zdd� Zdd� Zd S ) ap Display values only, separated by newlines ========================================== .. versionadded:: 2015.5.0 This outputter is designed for Salt CLI return data. It will do the following to the return dict: 1. Get just the values (ignoring the minion IDs). 2. Each value, if it is iterable, is split a separate line. 3. Each minion's values are separated by newlines. This results in a single string of return data containing all the values from the various minions. .. warning:: As noted above, this outputter will discard the minion ID. If the minion ID is important, then an outputter that returns the full return dictionary in a parsable format (such as :mod:`json <salt.output.json>`, :mod:`pprint, <salt.output.pprint>`, or :mod:`yaml <salt.output.yaml>`) may be more suitable. Example 1 ~~~~~~~~~ .. code-block:: bash salt '*' foo.bar --out=newline_values_only Input ----- .. code-block:: python { 'myminion': ['127.0.0.1', '10.0.0.1'], 'second-minion': ['127.0.0.1', '10.0.0.2'] } Output ------ .. code-block:: text 127.0.0.1 10.0.0.1 127.0.0.1 10.0.0.2 Example 2 ~~~~~~~~~ .. code-block:: bash salt '*' foo.bar --out=newline_values_only Input ----- .. code-block:: python { 'myminion': 8, 'second-minion': 10 } Output ------ .. code-block:: python 8 10 c C s: g }| � � D ]\}}t|t�r|�|� q|�|� q|S )N)�items� isinstance�list�extend�append)�data�values�_Z minion_values� r �S/opt/saltstack/salt/lib/python3.10/site-packages/salt/output/newline_values_only.py�_get_valuesP s r c C s d� tt| ���S )N� )�join�_string_listr )r r r r �_one_level_valuesa s r c C s dd� | D �S )Nc S s g | ]}t |��qS r )�str)�.0�itemr r r � <listcomp>f s z _string_list.<locals>.<listcomp>r )�a_listr r r r e s r c K s t | �S )z# Display modified ret data )r )r �kwargsr r r �outputi s r N)�__doc__r r r r r r r r �<module> s O
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings