diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2015-07-26 07:42:10 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2015-08-13 18:59:31 -0500 |
commit | 58cc453b2030ba904be48feb0c95e0df4a4fc9ac (patch) | |
tree | 6974f8e1f45d116c55dc97f4280550f54d97dea1 /keystoneclient/session.py | |
parent | 0d293eaf4413f82f55e3b13062b2bc710a6f3935 (diff) | |
download | python-keystoneclient-58cc453b2030ba904be48feb0c95e0df4a4fc9ac.tar.gz |
Proper deprecation for Session.construct()
Session.construct() wasn't properly deprecated since the deprecation
was only mentioned in the docstring. Proper deprecation requires use
of warnings/debtcollector and documentation.
bp deprecations
Change-Id: Ieff238aff9d39cfbbb80381b2392c33d0359acb3
Diffstat (limited to 'keystoneclient/session.py')
-rw-r--r-- | keystoneclient/session.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/keystoneclient/session.py b/keystoneclient/session.py index 88a53f3..5ec8a67 100644 --- a/keystoneclient/session.py +++ b/keystoneclient/session.py @@ -17,6 +17,7 @@ import logging import os import socket import time +import warnings from oslo_config import cfg from oslo_serialization import jsonutils @@ -525,15 +526,27 @@ class Session(object): new request-style arguments. .. warning:: - *DEPRECATED*: This function is purely for bridging the gap between - older client arguments and the session arguments that they relate - to. It is not intended to be used as a generic Session Factory. + + *DEPRECATED as of 1.7.0*: This function is purely for bridging the + gap between older client arguments and the session arguments that + they relate to. It is not intended to be used as a generic Session + Factory. This function may be removed in the 2.0.0 release. This function purposefully modifies the input kwargs dictionary so that the remaining kwargs dict can be reused and passed on to other functions without session arguments. """ + + warnings.warn( + 'Session.construct() is deprecated as of the 1.7.0 release in ' + 'favor of using session constructor and may be removed in the ' + '2.0.0 release.', DeprecationWarning) + + return cls._construct(kwargs) + + @classmethod + def _construct(cls, kwargs): params = {} for attr in ('verify', 'cacert', 'cert', 'key', 'insecure', |