X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a4ab52b4305023d8c679cc7c3b09361050d167b6..7dcac8234708b244251f957a4fc2ceb68ec06881:/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: