Skip to content
Snippets Groups Projects
Commit b8b78387 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Expand run folder to 4 digits in report backfill script

parent 4a685f27
No related branches found
No related tags found
1 merge request!943[Webservice] Create correction reports in MyMdC when jobs have finished
"""Backfill reports to myMdC from job databases before we started injecting them"""
import argparse
import os.path
import re
import shlex
import sys
import sqlite3
......@@ -36,6 +37,11 @@ for i, r in enumerate(rows):
print("Couldn't find report path in %r", cmd_args)
continue
# Workaround: we retrospectively renamed folders like 'r67' to 'r0067'.
def runnr_sub(m: re.Match):
return f'/r{m[1].zfill(4)}/'
report_path = re.sub(r'/r(\d{1,3})/', runnr_sub, report_path, count=1)
if not os.path.isfile(report_path):
print(f"Report file {report_path} missing (p{r['proposal']}, r{r['run']})")
continue
......
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