cve-generate-chartdata: Handle unexpected files in the stats directory
PATCH 1/1 cve-generate-chartdata: Handle unexpected files in the stats directory
A build of "stable/dunfell-nut" caused incorrect data to be added to the metrics repo and resulted in script failures. Handle this situation better.
Signed-off-by Richard Purdie <[email protected]>
--- scripts/cve-generate-chartdata | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/cve-generate-chartdata +5 -1
@@ -28,7 +28,11 @@ for branch in os.listdir(args.resultsdir): branchdir = os.path.join(args.resultsdir, branch) for f in os.listdir(branchdir): ts = f.split(".")[0] - rounded_ts = str(round_to_day(ts)) + try: + rounded_ts = str(round_to_day(ts)) + except ValueError: + # Couldn't parse a timestamp from filename + continue if rounded_ts not in counts: counts[rounded_ts] = {} if branch not in counts[rounded_ts]:
Signature · 1 line
2.40.1