summaryrefslogtreecommitdiff
path: root/keystoneclient/session.py
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-07-26 08:19:11 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-08-13 19:01:42 -0500
commit962ab574fd544eb996af1487a5596d7d3b7894b7 (patch)
tree19aaef83a5d6ca1648521cc3da3c5cacc5f00a38 /keystoneclient/session.py
parentafcf4a163ea841c71c66e2fe2d8a2e97e8a10912 (diff)
downloadpython-keystoneclient-962ab574fd544eb996af1487a5596d7d3b7894b7.tar.gz
Proper deprecation for Session.get_token()
Session.get_token() wasn't properly deprecated since the deprecation was only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. Also, changed a test to use the non-deprecated function instead where the test wasn't checking that the deprecated function worked. bp deprecations Change-Id: I3d421b35554d58476281e037f90ab9b48e82730a
Diffstat (limited to 'keystoneclient/session.py')
-rw-r--r--keystoneclient/session.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/keystoneclient/session.py b/keystoneclient/session.py
index e542edf..8ac5de6 100644
--- a/keystoneclient/session.py
+++ b/keystoneclient/session.py
@@ -19,6 +19,7 @@ import socket
import time
import warnings
+from debtcollector import removals
from oslo_config import cfg
from oslo_serialization import jsonutils
from oslo_utils import importutils
@@ -611,6 +612,8 @@ class Session(object):
auth = self._auth_required(auth, msg)
return auth.get_headers(self, **kwargs)
+ @removals.remove(message='Use get_auth_headers instead.', version='1.7.0',
+ removal_version='2.0.0')
def get_token(self, auth=None):
"""Return a token as provided by the auth plugin.
@@ -623,9 +626,12 @@ class Session(object):
:raises keystoneclient.exceptions.MissingAuthPlugin: if a plugin is not
available.
- *DEPRECATED*: This assumes that the only header that is used to
- authenticate a message is 'X-Auth-Token'. This may not be
- correct. Use get_auth_headers instead.
+ .. warning::
+
+ This method is deprecated as of the 1.7.0 release in favor of
+ :meth:`get_auth_headers` and may be removed in the 2.0.0 release.
+ This method assumes that the only header that is used to
+ authenticate a message is 'X-Auth-Token' which may not be correct.
:returns: A valid token.
:rtype: string