From ac979a9e1e6e2d332bf81742d16247569e3c5bec Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 14 Mar 2016 08:07:53 +0100 Subject: [PATCH] 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. --- autopkgtest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autopkgtest.py b/autopkgtest.py index 8cdf0ad..248bc1f 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -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: