Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def run(args):
logging.fatal(f"Could not find columns `runNumber` and `runType` in {args.runs_file}, make sure the column headers are correct.")
exit(1)

if run_type == "null":
if run_type == "null" or run_type == "":
logging.debug(f"Skipping run {run_number} because its type is `null`")
continue
logging.debug(f"Run : {run_number} -> {run_type}")
Expand All @@ -65,13 +65,21 @@ def run(args):
logging.info(f"Number of versions found: {len(versions)}")
total_planned += len(versions)
for version in versions:
if "RunNumber" not in version.metadata:
logging.debug(f"{version} misses metadata RunNumber")
continue
run_number = version.metadata["RunNumber"]
if version.metadata["RunNumber"] not in mapping_run_types:
logging.debug(f"No mapping run {version.metadata['RunNumber']}")
logging.debug(f"{version} : No mapping for run {version.metadata['RunNumber']}")
continue

run_type = mapping_run_types[run_number]
logging.info(f"Ready to update {version} : \"{version.metadata['RunType']}\" -> \"{run_type}\"")
old_run_type = version.metadata['RunType'] if 'RunType' in version.metadata else "null"
if old_run_type != run_type:
logging.info(f"Ready to update {version} : \"{old_run_type}\" -> \"{run_type}\"")
else:
logging.info(f"Won't update {version} : run type is already {run_type}")
continue

if args.print_list:
continue
Expand Down