From 8b949c33dee05e1364563f780b761e47e99648c1 Mon Sep 17 00:00:00 2001 From: versat Date: Mon, 2 Sep 2019 13:46:29 +0200 Subject: [PATCH] donate-cpu-server.py: Fix crash during diff report generation If there are *.diff files with old version numbers the server script crashed because it always expects a key with the current OLD_VERSION. This fix ignores entries in *.diff files that are not made against the current OLD_VERSION. --- tools/donate-cpu-server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/donate-cpu-server.py b/tools/donate-cpu-server.py index 99c6cc53d..4aa584618 100644 --- a/tools/donate-cpu-server.py +++ b/tools/donate-cpu-server.py @@ -18,7 +18,7 @@ import operator # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic # changes) -SERVER_VERSION = "1.1.4" +SERVER_VERSION = "1.1.5" OLD_VERSION = '1.89' @@ -258,6 +258,8 @@ def diffReport(resultsPath): uploadedToday = data['date'] == today for messageId in data['sums']: sums = data['sums'][messageId] + if OLD_VERSION not in sums: + continue if messageId not in out: out[messageId] = [0, 0] out[messageId][0] += sums[OLD_VERSION]