Skip to content
Snippets Groups Projects
Commit ac632c54 authored by Philipp Schmidt's avatar Philipp Schmidt
Browse files

Copy file before injection and delete copy if it fails

parent 7143789a
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !995. Comments created here will be created in the context of that merge request.
......@@ -184,15 +184,17 @@ def inject_ccv(const_src, ccv_root, report_to):
}
}
resp = CalibrationClient.inject_new_calibration_constant_version(calibration_client(), inject_h)
if not resp['success']:
raise RuntimeError(resp)
const_dest = _get_default_caldb_root() / const_rel_path / const_filename
const_dest.parent.mkdir(parents=True, exist_ok=True)
copyfile(const_src, const_dest)
resp = CalibrationClient.inject_new_calibration_constant_version(
calibration_client(), inject_h)
if not resp['success']:
const_dest.unlink() # Delete already copied CCV file.
raise RuntimeError(resp)
def inject_ccv_legacy(in_folder, metadata_folder, runs, calibration, cond,
pdu, const_input, begin_at):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment