MCPcopy
hub / github.com/saltstack/salt / pack

Method pack

salt/utils/event.py:551–567  ·  view source on GitHub ↗
(cls, tag, data, max_size=None)

Source from the content-addressed store, hash-verified

549
550 @classmethod
551 def pack(cls, tag, data, max_size=None):
552 tagend = TAGEND
553 serialized_data = salt.payload.dumps(data, use_bin_type=True)
554 if max_size:
555 serialized_data = salt.utils.dicttrim.trim_dict(
556 serialized_data,
557 max_size,
558 is_msgpacked=True,
559 use_bin_type=True,
560 )
561 return b"".join(
562 [
563 salt.utils.stringutils.to_bytes(tag),
564 salt.utils.stringutils.to_bytes(tagend),
565 serialized_data,
566 ]
567 )
568
569 def _get_match_func(self, match_type=None):
570 if match_type is None:

Callers 15

fire_event_asyncMethod · 0.95
fire_eventMethod · 0.95
_processValueItemFunction · 0.45
packFunction · 0.45
pack_exceptionFunction · 0.45
_roster_appendMethod · 0.45
_roster_removeMethod · 0.45
_roster_recoverMethod · 0.45
_append_to_heapMethod · 0.45
_overwrite_in_heapMethod · 0.45
atomic_rebuildMethod · 0.45

Calls 1

dumpsMethod · 0.45

Tested by 15

_fireFunction · 0.36
test_packerFunction · 0.36
test_unpackerFunction · 0.36
test_array_sizeFunction · 0.36
test_manual_resetFunction · 0.36
test_map_sizeFunction · 0.36
check_pack_unicodeFunction · 0.36
check_pack_floatFunction · 0.36
check_get_bufferFunction · 0.36
pillar_cache_filesFunction · 0.36