PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/renderers/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : //proc/self/root/opt/saltstack/salt/lib/python3.10/site-packages/salt/renderers/msgpack.py

import salt.utils.msgpack


def render(msgpack_data, saltenv="base", sls="", **kws):
    """
    Accepts a message pack string or a file object, renders said data back to
    a python dict.

    .. note:
        This renderer is NOT intended for use in creating sls files by hand,
        but exists to allow for data backends to serialize the highdata
        structure in an easily transportable way. This is to allow for more
        fluid fileserver backends that rely on pure data sources.

    :rtype: A Python data structure
    """
    if not isinstance(msgpack_data, str):
        msgpack_data = msgpack_data.read()

    if msgpack_data.startswith("#!"):
        msgpack_data = msgpack_data[(msgpack_data.find("\n") + 1) :]
    if not msgpack_data.strip():
        return {}
    return salt.utils.msgpack.loads(msgpack_data)