Merge "Proper deprecation for httpclient.request()"
This commit is contained in:
commit
1c76ed9266
keystoneclient
@ -21,6 +21,7 @@ OpenStack Client interface. Handles the REST calls and responses.
|
||||
|
||||
import logging
|
||||
|
||||
from debtcollector import removals
|
||||
from oslo_serialization import jsonutils
|
||||
import pkg_resources
|
||||
import requests
|
||||
@ -64,10 +65,21 @@ from keystoneclient import utils
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
# These variables are moved and using them via httpclient is deprecated.
|
||||
# This variable is moved and using it via httpclient is deprecated.
|
||||
# Maintain here for compatibility.
|
||||
USER_AGENT = client_session.USER_AGENT
|
||||
request = client_session.request
|
||||
|
||||
|
||||
@removals.remove(message='Use keystoneclient.session.request instead.',
|
||||
version='1.7.0', removal_version='2.0.0')
|
||||
def request(*args, **kwargs):
|
||||
"""Make a request.
|
||||
|
||||
This function is deprecated as of the 1.7.0 release in favor of
|
||||
:func:`keystoneclient.session.request` and may be removed in the
|
||||
2.0.0 release.
|
||||
"""
|
||||
return client_session.request(*args, **kwargs)
|
||||
|
||||
|
||||
class _FakeRequestSession(object):
|
||||
|
@ -167,7 +167,8 @@ class BasicRequestTests(utils.TestCase):
|
||||
self.requests_mock.register_uri(method, url, text=response,
|
||||
status_code=status_code)
|
||||
|
||||
return httpclient.request(url, method, **kwargs)
|
||||
with self.deprecations.expect_deprecations_here():
|
||||
return httpclient.request(url, method, **kwargs)
|
||||
|
||||
def test_basic_params(self):
|
||||
method = 'GET'
|
||||
|
Loading…
x
Reference in New Issue
Block a user