diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2015-07-24 13:57:12 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2015-07-26 06:54:22 -0500 |
commit | b1496abbb77360672d1d94e689513daeeb3cafd0 (patch) | |
tree | cbefd18c3e6f186a6382143f38d49eb2954a01ce /keystoneclient/auth | |
parent | 799e1faa505ac0c62d6db76ad68cdbb2d7148888 (diff) | |
download | python-keystoneclient-b1496abbb77360672d1d94e689513daeeb3cafd0.tar.gz |
Proper deprecation for BaseIdentityPlugin trust_id property
BaseIdentityPlugin's trust_id property wasn't properly deprecated
since all it had was a comment in the code. Proper deprecation
requires use of warnings and documentation.
Where the plugins already provide their own trust_id, the
property needs to be un-deprecated.
bp deprecations
Change-Id: I15d4e019bfc5542990120ba39be65ad83cf040d5
Diffstat (limited to 'keystoneclient/auth')
-rw-r--r-- | keystoneclient/auth/identity/base.py | 28 | ||||
-rw-r--r-- | keystoneclient/auth/identity/generic/base.py | 10 | ||||
-rw-r--r-- | keystoneclient/auth/identity/v2.py | 12 | ||||
-rw-r--r-- | keystoneclient/auth/identity/v3/base.py | 12 |
4 files changed, 57 insertions, 5 deletions
diff --git a/keystoneclient/auth/identity/base.py b/keystoneclient/auth/identity/base.py index b6ff4ae..57e1723 100644 --- a/keystoneclient/auth/identity/base.py +++ b/keystoneclient/auth/identity/base.py @@ -58,9 +58,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): self._username = username self._password = password self._token = token - # NOTE(jamielennox): DEPRECATED. The following should not really be set - # here but handled by the individual auth plugin. - self.trust_id = trust_id + self._trust_id = trust_id @property def username(self): @@ -134,6 +132,30 @@ class BaseIdentityPlugin(base.BaseAuthPlugin): self._token = value + @property + def trust_id(self): + """Deprecated as of the 1.7.0 release and may be removed in the 2.0.0 + release. + """ + + warnings.warn( + 'trust_id is deprecated as of the 1.7.0 release and may be ' + 'removed in the 2.0.0 release.', DeprecationWarning) + + return self._trust_id + + @trust_id.setter + def trust_id(self, value): + """Deprecated as of the 1.7.0 release and may be removed in the 2.0.0 + release. + """ + + warnings.warn( + 'trust_id is deprecated as of the 1.7.0 release and may be ' + 'removed in the 2.0.0 release.', DeprecationWarning) + + self._trust_id = value + @abc.abstractmethod def get_auth_ref(self, session, **kwargs): """Obtain a token from an OpenStack Identity Service. diff --git a/keystoneclient/auth/identity/generic/base.py b/keystoneclient/auth/identity/generic/base.py index 0b87d06..d366707 100644 --- a/keystoneclient/auth/identity/generic/base.py +++ b/keystoneclient/auth/identity/generic/base.py @@ -72,6 +72,16 @@ class BaseGenericPlugin(base.BaseIdentityPlugin): self._plugin = None + @property + def trust_id(self): + # Override to remove deprecation. + return self._trust_id + + @trust_id.setter + def trust_id(self, value): + # Override to remove deprecation. + self._trust_id = value + @abc.abstractmethod def create_plugin(self, session, version, url, raw_status=None): """Create a plugin from the given paramters. diff --git a/keystoneclient/auth/identity/v2.py b/keystoneclient/auth/identity/v2.py index 725da3b..fd8b422 100644 --- a/keystoneclient/auth/identity/v2.py +++ b/keystoneclient/auth/identity/v2.py @@ -57,10 +57,20 @@ class Auth(base.BaseIdentityPlugin): super(Auth, self).__init__(auth_url=auth_url, reauthenticate=reauthenticate) - self.trust_id = trust_id + self._trust_id = trust_id self.tenant_id = tenant_id self.tenant_name = tenant_name + @property + def trust_id(self): + # Override to remove deprecation. + return self._trust_id + + @trust_id.setter + def trust_id(self, value): + # Override to remove deprecation. + self._trust_id = value + def get_auth_ref(self, session, **kwargs): headers = {'Accept': 'application/json'} url = self.auth_url.rstrip('/') + '/tokens' diff --git a/keystoneclient/auth/identity/v3/base.py b/keystoneclient/auth/identity/v3/base.py index 9d1f562..784bd96 100644 --- a/keystoneclient/auth/identity/v3/base.py +++ b/keystoneclient/auth/identity/v3/base.py @@ -59,7 +59,7 @@ class BaseAuth(base.BaseIdentityPlugin): include_catalog=True): super(BaseAuth, self).__init__(auth_url=auth_url, reauthenticate=reauthenticate) - self.trust_id = trust_id + self._trust_id = trust_id self.domain_id = domain_id self.domain_name = domain_name self.project_id = project_id @@ -69,6 +69,16 @@ class BaseAuth(base.BaseIdentityPlugin): self.include_catalog = include_catalog @property + def trust_id(self): + # Override to remove deprecation. + return self._trust_id + + @trust_id.setter + def trust_id(self, value): + # Override to remove deprecation. + self._trust_id = value + + @property def token_url(self): """The full URL where we will send authentication data.""" return '%s/auth/tokens' % self.auth_url.rstrip('/') |