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:
Brant Knudson
2015-07-24 14:32:29 -05:00
parent 5547fe80b0
commit a303cbc0ec
2 changed files with 10 additions and 3 deletions

View File

@@ -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.

View File

@@ -499,7 +499,8 @@ class ClientDiscoveryTests(utils.TestCase):
text=V3_VERSION_ENTRY)
disc = discover.Discover(auth_url=BASE_URL)
versions = disc.available_versions()
with self.deprecations.expect_deprecations_here():
versions = disc.available_versions()
self.assertEqual(1, len(versions))
self.assertEqual(V3_VERSION, versions[0])