Repair requests without testpkg-version

We're supposed to synthesise an "unknown" version for these, but a bug
in the worker meant we didn't do that in some cases and these leaked
into swift. Let's repair it client-side.
sru-regression-messages
Iain Lane 6 years ago
parent 0ff44d90e7
commit bbabac140d
No known key found for this signature in database
GPG Key ID: E352D5C51C5041D4

@ -528,7 +528,14 @@ class AutopkgtestPolicy(BasePolicy):
try:
with tarfile.open(None, 'r', tar_bytes) as tar:
exitcode = int(tar.extractfile('exitcode').read().strip())
try:
srcver = tar.extractfile('testpkg-version').read().decode().strip()
except KeyError as e:
if exitcode in (4, 12, 20):
# repair it
srcver = "%s unknown" % (src)
else:
raise
(ressrc, ver) = srcver.split()
testinfo = json.loads(tar.extractfile('testinfo.json').read().decode())
except (KeyError, ValueError, tarfile.TarError) as e:

Loading…
Cancel
Save