Allow meta-data to contain any yaml
Some checks failed
buildbot/travis_bionic Build done.

This commit is contained in:
Peter Šurda 2021-06-09 19:13:23 +08:00
parent 3430109353
commit e5b9d45a59
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -142,9 +142,7 @@ class CloudInitApp:
filepath = os.path.join(PATH, "data", data['local-hostname'], META_DATA_FILENAME)
if os.path.exists(filepath):
with open(filepath, "r") as metadata:
for line in metadata.readlines():
linesplit = list(map(lambda k: k.strip(), line.split(":")))
data[linesplit[0]] = linesplit[1]
data.update(yaml.safe_load(metadata))
cherrypy.response.headers['Content-Type'] = \
'text/yaml'