fix: parse more than the first line of metadata

This commit is contained in:
Peter Šurda 2021-03-01 10:32:07 +01:00
parent 2913a8aa24
commit 534b33fa52
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -76,10 +76,10 @@ class MainApp:
filepath = os.path.join(PATH, "data", hostname, meta_data_filename)
if os.path.exists(filepath):
with open(filepath, "r") as f:
line = f.readlines()[0]
ls = list(map(lambda k: k.strip(), line.split(":")))
data[ls[0]] = ls[1]
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]
return yaml.dump(data)