MCPcopy Create free account
hub / github.com/canonical/cloud-init / create_binmsg

Function create_binmsg

cloudinit/user_data.py:371–375  ·  view source on GitHub ↗
(data, content_type)

Source from the content-addressed store, hash-verified

369 raw_data = b""
370
371 def create_binmsg(data, content_type):
372 maintype, subtype = content_type.split("/", 1)
373 msg = MIMEBase(maintype, subtype)
374 msg.set_payload(data)
375 return msg
376
377 if isinstance(raw_data, str):
378 bdata = raw_data.encode("utf-8")

Callers 1

convert_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected