summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-07-24 15:34:27 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-08-04 09:56:44 -0500
commitada04acf4d60eafc0e31e6ac079ddb2c4f12e728 (patch)
treed61ee73e9526d27bd9d0606a2fed48f230bb0102
parent1721e01743324fc10630131d590659f565a3684d (diff)
downloadpython-keystoneclient-ada04acf4d60eafc0e31e6ac079ddb2c4f12e728.tar.gz
Proper deprecation for HTTPClient.tenant_id|name
HTTPClient tenant_id and tenant_name properties weren't properly deprecated since they were only mentioned in the docstring. Proper deprecation requires use of warnings/debtcollector and documentation. bp deprecations Change-Id: I3c2f87df14bc9f8ffd82b99919fd1048123d0669
-rw-r--r--keystoneclient/httpclient.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py
index fb7495f..933c1ff 100644
--- a/keystoneclient/httpclient.py
+++ b/keystoneclient/httpclient.py
@@ -20,6 +20,7 @@ OpenStack Client interface. Handles the REST calls and responses.
"""
import logging
+import warnings
from debtcollector import removals
from debtcollector import renames
@@ -424,15 +425,35 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
@property
def tenant_id(self):
"""Provide read-only backwards compatibility for tenant_id.
- This is deprecated, use project_id instead.
+
+ .. warning::
+
+ This is deprecated as of the 1.7.0 release in favor of project_id
+ and may be removed in the 2.0.0 release.
"""
+
+ warnings.warn(
+ 'tenant_id is deprecated as of the 1.7.0 release in favor of '
+ 'project_id and may be removed in the 2.0.0 release.',
+ DeprecationWarning)
+
return self.project_id
@property
def tenant_name(self):
"""Provide read-only backwards compatibility for tenant_name.
- This is deprecated, use project_name instead.
+
+ .. warning::
+
+ This is deprecated as of the 1.7.0 release in favor of project_name
+ and may be removed in the 2.0.0 release.
"""
+
+ warnings.warn(
+ 'tenant_name is deprecated as of the 1.7.0 release in favor of '
+ 'project_name and may be removed in the 2.0.0 release.',
+ DeprecationWarning)
+
return self.project_name
@utils.positional(enforcement=utils.positional.WARN)