keep yaml metadata when rewrite failed

This commit is contained in:
Michael Pöhn 2019-07-22 19:49:28 +02:00
parent cb131b45ab
commit 08acb55897
2 changed files with 13 additions and 13 deletions

View file

@ -108,10 +108,14 @@ def main():
newbuilds.append(new)
app.builds = newbuilds
metadata.write_metadata(base + '.' + to_ext, app)
if ext != to_ext:
os.remove(path)
try:
metadata.write_metadata(base + '.' + to_ext, app)
# remove old format metadata if there was a format change
# and rewriting to the new format worked
if ext != to_ext:
os.remove(path)
finally:
pass
logging.debug(_("Finished"))