diff options
-rwxr-xr-x | linaro-cp.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linaro-cp.py b/linaro-cp.py index 14dd6d8..9dfa919 100755 --- a/linaro-cp.py +++ b/linaro-cp.py @@ -47,8 +47,12 @@ class API_v1(object): return repr(e) code = self.curl.getinfo(pycurl.RESPONSE_CODE) + if code == 503 and retry_count > 0: + print('503 failure for %s, retrying in 2 seconds' % url) + time.sleep(2) + return self._upload_data(url, data, headers, retry_count - 1) if code not in (200, 201): - return response.getvalue() + return 'HTTP_%d: %s' % (code, response.getvalue()) def upload_file(self, url, filename): data = [ |