Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Retry): replace method_whitelist #2119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions atomic_reactor/utils/cachito.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def __init__(self, api_url, insecure=False, cert=None, timeout=None):
self.timeout = 3600 if timeout is None else timeout

def _make_session(self, insecure, cert):
# method_whitelist=False allows retrying non-idempotent methods like POST
session = get_retrying_requests_session(method_whitelist=False)
# allowed_methods=False allows retrying non-idempotent methods like POST
session = get_retrying_requests_session(allowed_methods=False)
session.verify = not insecure
if cert:
session.cert = cert
Expand Down
4 changes: 2 additions & 2 deletions atomic_reactor/utils/odcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(self, url, insecure=False, token=None, cert=None,
self._setup_session(insecure=insecure, token=token, cert=cert, kerberos_auth=kerberos_auth)

def _setup_session(self, insecure, token, cert, kerberos_auth):
# method_whitelist=False allows retrying non-idempotent methods like POST
session = get_retrying_requests_session(method_whitelist=False)
# allowed_methods=False allows retrying non-idempotent methods like POST
session = get_retrying_requests_session(allowed_methods=False)

session.verify = not insecure

Expand Down
4 changes: 2 additions & 2 deletions atomic_reactor/utils/retries.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ def hook_log_error_response_content(response, *args, **kwargs):

def get_retrying_requests_session(client_statuses=HTTP_CLIENT_STATUS_RETRY,
times=HTTP_MAX_RETRIES, delay=HTTP_BACKOFF_FACTOR,
method_whitelist=None, raise_on_status=True):
allowed_methods=None, raise_on_status=True):
if _http_retries_disabled():
times = 0

retry = Retry(
total=int(times),
backoff_factor=delay,
status_forcelist=client_statuses,
method_whitelist=method_whitelist
allowed_methods=allowed_methods
)

# raise_on_status was added later to Retry, adding compatibility to work
Expand Down