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: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

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