fix: parse more than the first line of metadata

master
Peter Šurda 2 years ago
parent 2913a8aa24
commit 534b33fa52
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
  1. 8
      main.py

@ -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)

Loading…
Cancel
Save