MCPcopy Create free account
hub / github.com/saltstack/salt / pack

Function pack

salt/utils/msgpack.py:96–109  ·  view source on GitHub ↗

.. versionadded:: 2018.3.4 Wraps msgpack.pack and ensures that the passed object is unwrapped if it is a proxy. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available.

(o, stream, **kwargs)

Source from the content-addressed store, hash-verified

94
95
96def pack(o, stream, **kwargs):
97 """
98 .. versionadded:: 2018.3.4
99
100 Wraps msgpack.pack and ensures that the passed object is unwrapped if it is
101 a proxy.
102
103 By default, this function uses the msgpack module and falls back to
104 msgpack_pure, if the msgpack is not available.
105 """
106 if not msgpack:
107 raise RuntimeError("msgpack is not available")
108 # Writes to a stream, there is no return
109 msgpack.pack(o, stream, **_sanitize_msgpack_kwargs(kwargs))
110
111
112def packb(o, **kwargs):

Callers

nothing calls this directly

Calls 2

_sanitize_msgpack_kwargsFunction · 0.85
packMethod · 0.45

Tested by

no test coverage detected