X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5a9aaf3f32fc0414ae16aed17a77388cf4af9f90..ad76f76cdd557d61497aa0ff26e0537788f2d5b6:/sdk/python/arvados/retry.py diff --git a/sdk/python/arvados/retry.py b/sdk/python/arvados/retry.py index 3d2fc48e31..52a68faa6f 100644 --- a/sdk/python/arvados/retry.py +++ b/sdk/python/arvados/retry.py @@ -110,11 +110,11 @@ class RetryLoop(object): def check_http_response_success(result): - """Convert an httplib2 request result to a loop control flag. + """Convert a 'requests' response to a loop control flag. - Pass this method the 2-tuple returned by httplib2.Http.request. It - returns True if the response indicates success, None if it indicates - temporary failure, and False otherwise. You can use this as the + Pass this method a requests.Response object. It returns True if + the response indicates success, None if it indicates temporary + failure, and False otherwise. You can use this as the success_check for a RetryLoop. Implementation details: @@ -129,7 +129,7 @@ def check_http_response_success(result): retry those requests verbatim. """ try: - status = int(result[0].status) + status = result.status_code except Exception: return None if status in _HTTP_SUCCESSES: