Commit de12acb3 authored by marc duez's avatar marc duez

migrator.py: rollback databases change if file copy fail

parent 445f2ce8
Pipeline #175990 passed with stages
in 12 minutes and 3 seconds
......@@ -372,9 +372,9 @@ def import_data(filesrc, filedest, groupid, config=None, pprocess=None, dry_run=
db.rollback()
log.info("dry run successful, no data saved")
else:
db.commit()
log.info("copying files from %s to %s" % (filesrc, filedest))
copy_files(data, filesrc + '/files', filedest, log=log)
db.commit()
log.info("done")
except:
log.error("something went wrong, rolling back")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment