From ada04acf4d60eafc0e31e6ac079ddb2c4f12e728 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Fri, 24 Jul 2015 15:34:27 -0500 Subject: [PATCH] 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 --- keystoneclient/httpclient.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/keystoneclient/httpclient.py b/keystoneclient/httpclient.py index fb7495fca..933c1ff09 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)