File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/serializers/__pycache__/keyvalue.cpython-310.pyc
Back
o ;jS � @ sT d Z ddlZddlmZmZ ddlmZ ddlm Z g d�Z dZdd � Zd d� Z dS )a} salt.serializers.keyvalue ~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 3006.0 Implements keyvalue serializer which can be used for serializing or deserializing any file which defines keys and values separated by a common set of characters, such environment files, which are in "KEY=value" format. Options: :param line_ending: String representation of LF or CRLF to be used for serialization to a file. Defaults to ``\r\n`` on Windows and ``\n`` on other operating systems. :param quoting: Boolean flag to determine if values should be quoted (``True``) during serialization or dequoted (``False``) during deserialization. Defaults to ``None`` (no action). :param separator: String representing the character(s) used when concatenating or reading key/value pairs. Defaults to ``=``. A dataset such as: .. code-block:: yaml foo: bar wang: chung or .. code-block:: yaml - [foo, bar] - [wang, chung] can be represented as: .. code-block:: text foo=bar wang=chung � N)�DeserializationError�SerializationError)�quote)�dequote)�deserialize� serialize� availableTc K s� z?t | ttf�s| �� } |�dd�}i }t | t�r| �d�} | �� D ]}|j|dd�\}}|�d�du r8t|�}|||<