Merge "Deprecate the generic client"

This commit is contained in:
Jenkins
2016-12-08 20:27:37 +00:00
committed by Gerrit Code Review
3 changed files with 13 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
import logging
from debtcollector import removals
from six.moves.urllib import parse as urlparse
from keystoneclient import exceptions
@@ -25,6 +26,11 @@ from keystoneclient.i18n import _, _LE
_logger = logging.getLogger(__name__)
# NOTE(jamielennox): To be removed after Pike.
@removals.removed_class('keystoneclient.generic.client.Client',
message='Use keystoneauth discovery',
version='3.9.0',
removal_version='4.0.0')
class Client(httpclient.HTTPClient):
"""Client for the OpenStack Keystone pre-version calls API.

View File

@@ -0,0 +1,6 @@
---
deprecations:
- Deprecate the `keystoneclient.generic` client. This client used to be able
to determine available API versions and some basics around installed
extensions however the APIs were never upgraded for the v3 API. It doesn't
seem to be used in the openstack ecosystem.

View File

@@ -58,6 +58,7 @@ class ClientDiscoveryTests(utils.TestCase):
def test_discover_extensions_v2(self):
self.requests_mock.get("%s/extensions" % V2_URL, text=EXTENSION_LIST)
# Creating a HTTPClient not using session is deprecated.
# creating a generic client at all is deprecated.
with self.deprecations.expect_deprecations_here():
extensions = client.Client().discover_extensions(url=V2_URL)
self.assertIn(EXTENSION_ALIAS_FOO, extensions)