summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-07-26 08:25:53 -0500
committerAndy Doan <andy.doan@linaro.org>2016-07-26 08:25:53 -0500
commit9e58c2138ad47ef2deb19368ef31880b10e146f0 (patch)
tree3b680896ac47b43a9119745deb01c7a032fab07a
parentfa6a3dd8367fdfd6e7fb8a2d1eabf303e22a510f (diff)
downloadpublishing-api-9e58c2138ad47ef2deb19368ef31880b10e146f0.tar.gz
bug #2434 - more debugging
Change this to *always* retry on S3. The 503 logic wasn't catching the failure we see. Change-Id: I2f7e93181361ca61f8d257e31a9fc7bb20b15303
-rwxr-xr-xlinaro-cp.py6
1 files 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):