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.
This commit is contained in:
versat 2019-09-02 13:46:29 +02:00
parent a35de895ca
commit 8b949c33de
1 changed files with 3 additions and 1 deletions

View File

@ -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]