From 9e58c2138ad47ef2deb19368ef31880b10e146f0 Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Tue, 26 Jul 2016 08:25:53 -0500 Subject: bug #2434 - more debugging Change this to *always* retry on S3. The 503 logic wasn't catching the failure we see. Change-Id: I2f7e93181361ca61f8d257e31a9fc7bb20b15303 --- linaro-cp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linaro-cp.py b/linaro-cp.py index 43f9aaa..e147685 100755 --- a/linaro-cp.py +++ b/linaro-cp.py @@ -182,11 +182,11 @@ class API_v3(API_v1): else: return repr(e) code = c.getinfo(pycurl.RESPONSE_CODE) - if code == 503 and retry_count > 0: - print('503 failure for %s, retrying in 2 seconds' % url) + if code not in (200, 201): + if retry_count > 0: + print('%d failure for %s, retrying in 2 seconds' % (code, url)) time.sleep(2) return self._put_s3(url, filename, mtype, retry_count - 1) - if code not in (200, 201): return response.getvalue() def upload_file(self, url, filename): -- cgit v1.2.3