autopkgtest: Don't fail hard on 404 download errors

Dial back commit 570 a bit: We should tolerate 404's, something went wrong on
uploading the result. We still want to fail hard on any other error as these
would indicate infra problems.
This commit is contained in:
Martin Pitt 2016-03-14 08:07:53 +01:00
parent d0337785d8
commit ac979a9e1e

View File

@ -380,7 +380,11 @@ class AutoPackageTest(object):
raise NotImplementedError('fetch_one_result(%s): cannot handle HTTP code %i' %
(url, f.getcode()))
except IOError as e:
self.log_error('FATAL: Failure to fetch %s: %s' % (url, str(e)))
self.log_error('Failure to fetch %s: %s' % (url, str(e)))
# we tolerate "not found" (something went wrong on uploading the
# result), but other things indicate infrastructure problems
if hasattr(e, 'code') and e.code == 404:
return
sys.exit(1)
try: