Cleanup deprecated session variables
Remove some old deprecated variables on the session object. Make the positional checks actually enforce positional. Change-Id: Icf62e09b57d447eb2a1506a4d1a44470d0729f05
This commit is contained in:
parent
2e23129e1f
commit
f3b037990c
|
@ -115,15 +115,9 @@ class Session(object):
|
||||||
|
|
||||||
_REDIRECT_STATUSES = (301, 302, 303, 305, 307)
|
_REDIRECT_STATUSES = (301, 302, 303, 305, 307)
|
||||||
|
|
||||||
REDIRECT_STATUSES = _REDIRECT_STATUSES
|
|
||||||
"""This property is deprecated."""
|
|
||||||
|
|
||||||
_DEFAULT_REDIRECT_LIMIT = 30
|
_DEFAULT_REDIRECT_LIMIT = 30
|
||||||
|
|
||||||
DEFAULT_REDIRECT_LIMIT = _DEFAULT_REDIRECT_LIMIT
|
@utils.positional(2)
|
||||||
"""This property is deprecated."""
|
|
||||||
|
|
||||||
@utils.positional(2, enforcement=utils.positional.WARN)
|
|
||||||
def __init__(self, auth=None, session=None, original_ip=None, verify=True,
|
def __init__(self, auth=None, session=None, original_ip=None, verify=True,
|
||||||
cert=None, timeout=None, user_agent=None,
|
cert=None, timeout=None, user_agent=None,
|
||||||
redirect=_DEFAULT_REDIRECT_LIMIT):
|
redirect=_DEFAULT_REDIRECT_LIMIT):
|
||||||
|
@ -223,7 +217,7 @@ class Session(object):
|
||||||
|
|
||||||
logger.debug(' '.join(string_parts))
|
logger.debug(' '.join(string_parts))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@utils.positional()
|
||||||
def request(self, url, method, json=None, original_ip=None,
|
def request(self, url, method, json=None, original_ip=None,
|
||||||
user_agent=None, redirect=None, authenticated=None,
|
user_agent=None, redirect=None, authenticated=None,
|
||||||
endpoint_filter=None, auth=None, requests_auth=None,
|
endpoint_filter=None, auth=None, requests_auth=None,
|
||||||
|
@ -424,7 +418,7 @@ class Session(object):
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
msg = _('Unable to establish connection to %s') % url
|
msg = _('Unable to establish connection to %s') % url
|
||||||
raise exceptions.ConnectFailure(msg)
|
raise exceptions.ConnectFailure(msg)
|
||||||
except requests.exception.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
msg = _('Unexpected exception for %(url)s: %(error)s') % {
|
msg = _('Unexpected exception for %(url)s: %(error)s') % {
|
||||||
'url': url, 'error': e}
|
'url': url, 'error': e}
|
||||||
raise exceptions.UnknownConnectionError(msg, e)
|
raise exceptions.UnknownConnectionError(msg, e)
|
||||||
|
|
Loading…
Reference in New Issue