Commit 58932022 authored by marc duez's avatar marc duez

Merge branch 'feature-s/fix_migrator_script' into 'dev'

Feature s/fix migrator script

See merge request !818
parents e9393969 de12acb3
Pipeline #175995 passed with stages
in 14 minutes and 42 seconds
......@@ -247,8 +247,11 @@ def copy_files(data, src, dest, log=MigrateLogger()):
for t in file_fields:
for entry in data[t]:
if (data[t][entry][file_fields[t]] is not None):
log.debug("Copying %s" % data[t][entry][file_fields[t]])
copy(src + '/' + data[t][entry][file_fields[t]], dest + '/' + data[t][entry][file_fields[t]])
try:
copy(src + '/' + data[t][entry][file_fields[t]], dest + '/' + data[t][entry][file_fields[t]])
log.debug("Copying %s" % data[t][entry][file_fields[t]])
except:
log.error("failed to copy file %s" % data[t][entry][file_fields[t]])
def export_peripheral_data(extractor, data_dict, sample_set_ids, log=MigrateLogger()):
sequence_rows = extractor.getSequenceFiles(sample_set_ids)
......@@ -369,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