Proper deprecation for Dicover.available_versions()
Dicover.available_versions() wasn't properly deprecated since it was only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. bp deprecations Change-Id: Ifbcedec1d464435ebb9bcec779fadac0dfb28909
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from debtcollector import removals
|
||||
import six
|
||||
|
||||
from keystoneclient import _discover
|
||||
@@ -165,14 +166,19 @@ class Discover(_discover.Discover):
|
||||
super(Discover, self).__init__(session, url,
|
||||
authenticated=authenticated)
|
||||
|
||||
@removals.remove(message='Use raw_version_data instead.', version='1.7.0',
|
||||
removal_version='2.0.0')
|
||||
def available_versions(self, **kwargs):
|
||||
"""Return a list of identity APIs available on the server and the data
|
||||
associated with them.
|
||||
|
||||
DEPRECATED: use raw_version_data()
|
||||
.. warning::
|
||||
|
||||
This method is deprecated as of the 1.7.0 release in favor of
|
||||
:meth:`raw_version_data` and may be removed in the 2.0.0 release.
|
||||
|
||||
:param bool unstable: Accept endpoints not marked 'stable'. (optional)
|
||||
DEPRECTED. Equates to setting allow_experimental
|
||||
Equates to setting allow_experimental
|
||||
and allow_unknown to True.
|
||||
:param bool allow_experimental: Allow experimental version endpoints.
|
||||
:param bool allow_deprecated: Allow deprecated version endpoints.
|
||||
|
@@ -499,6 +499,7 @@ class ClientDiscoveryTests(utils.TestCase):
|
||||
text=V3_VERSION_ENTRY)
|
||||
disc = discover.Discover(auth_url=BASE_URL)
|
||||
|
||||
with self.deprecations.expect_deprecations_here():
|
||||
versions = disc.available_versions()
|
||||
self.assertEqual(1, len(versions))
|
||||
self.assertEqual(V3_VERSION, versions[0])
|
||||
|
Reference in New Issue
Block a user