Ubuntu Pastebin

Paste from Joshua Harlow at Tue, 24 Mar 2015 17:54:48 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from cloudinit.handlers import cloud_config
from cloudinit import handlers
from cloudinit import helpers
from cloudinit import log as logging

logging.setupBasicLogging()

# Put your yaml sections in here.
pieces = []
pieces.append(
"""#cloud-config
a: b
"""
)

# Set things up...
ctype = handlers.type_from_starts_with(cloud_config.CLOUD_PREFIX)
h = cloud_config.CloudConfigPartHandler(helpers.Paths({}))
h.handle_part("", handlers.CONTENT_START, "", "", "", {})

for p in pieces:
    h.handle_part("", ctype, "", p, "", {})

print("Merged result:")
print(h.cloud_buf)
Download as text