diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py index 9c51f6de4..37c6a4db6 100644 --- a/keystoneclient/httpclient.py +++ b/keystoneclient/httpclient.py @@ -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): diff --git a/keystoneclient/tests/unit/test_http.py b/keystoneclient/tests/unit/test_http.py index 436c374b7..9a8bee238 100644 --- a/keystoneclient/tests/unit/test_http.py +++ b/keystoneclient/tests/unit/test_http.py @@ -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'