summaryrefslogtreecommitdiff
path: root/keystoneclient/v2_0
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-07-26 08:46:27 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-08-13 19:01:42 -0500
commitb94a61012ed9749f818e88366c57aa566a39101d (patch)
treec22e6382f8f155b76de02c579994ae338c498875 /keystoneclient/v2_0
parent962ab574fd544eb996af1487a5596d7d3b7894b7 (diff)
downloadpython-keystoneclient-b94a61012ed9749f818e88366c57aa566a39101d.tar.gz
Deprecate create v2_0 Client without session
There was a comment to deprecate creating a v2_0 Client without a session. bp deprecations Change-Id: I71ff64754c8f90d184615eeec558718c11a1794a
Diffstat (limited to 'keystoneclient/v2_0')
-rw-r--r--keystoneclient/v2_0/client.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py
index bba556e..7553164 100644
--- a/keystoneclient/v2_0/client.py
+++ b/keystoneclient/v2_0/client.py
@@ -14,6 +14,7 @@
# under the License.
import logging
+import warnings
from keystoneclient.auth.identity import v2 as v2_auth
from keystoneclient import exceptions
@@ -79,6 +80,11 @@ class Client(httpclient.HTTPClient):
If debug is enabled, it may show passwords in plain text as a part of
its output.
+ .. warning::
+
+ Constructing an instance of this class without a session is
+ deprecated as of the 1.7.0 release and will be removed in the
+ 2.0.0 release.
The client can be created and used like a user or in a strictly
bootstrap mode. Normal operation expects a username, password, auth_url,
@@ -130,6 +136,14 @@ class Client(httpclient.HTTPClient):
def __init__(self, **kwargs):
"""Initialize a new client for the Keystone v2.0 API."""
+
+ if not kwargs.get('session'):
+ warnings.warn(
+ 'Constructing an instance of the '
+ 'keystoneclient.v2_0.client.Client class without a session is '
+ 'deprecated as of the 1.7.0 release and may be removed in '
+ 'the 2.0.0 release.', DeprecationWarning)
+
super(Client, self).__init__(**kwargs)
self.certificates = certificates.CertificatesManager(self._adapter)