gitlab: add missing f.truncate() call to update.py script

when updating data.json, truncate file after reading and before writing
again, or we otherwise might end up with broken json
This commit is contained in:
Florian Klink 2018-12-24 03:00:14 +01:00
parent 747fd9fb00
commit 78f336b21d

View File

@ -115,6 +115,7 @@ def _update_data_json(filename: str, repo: GitLabRepo, rev: str, flavour: str):
data = json.load(f)
data[flavour] = flavour_data
f.seek(0)
f.truncate()
json.dump(data, f, indent=2)