diff options
author | Brant Knudson <bknudson@us.ibm.com> | 2015-08-06 09:37:43 -0500 |
---|---|---|
committer | Brant Knudson <bknudson@us.ibm.com> | 2015-08-06 09:37:43 -0500 |
commit | 4e498a54d0034b2ce5c87130f080ff580d241600 (patch) | |
tree | d21d11091373e80bf1a4f70ecf1ee54ff82e0ff8 /keystoneclient/access.py | |
parent | d5c5423d6de3710e3480e47062333b33e8de0713 (diff) | |
parent | eae8e83f5a7a170b98ef2d74a4ffd9eac7cc47ba (diff) | |
download | python-keystoneclient-feature/keystoneauth_integration.tar.gz |
Merge remote-tracking branch 'origin/master' into merge-branchfeature/keystoneauth_integration
Conflicts:
keystoneclient/exceptions.py
keystoneclient/fixture/discovery.py
keystoneclient/fixture/v2.py
keystoneclient/fixture/v3.py
keystoneclient/middleware/auth_token.py
keystoneclient/middleware/s3_token.py
keystoneclient/tests/unit/test_auth_token_middleware.py
keystoneclient/tests/unit/test_memcache_crypt.py
keystoneclient/tests/unit/test_s3_token_middleware.py
requirements.txt
test-requirements.txt
Change-Id: Ib51acebaac7966bf37c1562fa15b9061df6a7aa5
Diffstat (limited to 'keystoneclient/access.py')
-rw-r--r-- | keystoneclient/access.py | 77 |
1 files changed, 64 insertions, 13 deletions
diff --git a/keystoneclient/access.py b/keystoneclient/access.py index 009b72e..f308a58 100644 --- a/keystoneclient/access.py +++ b/keystoneclient/access.py @@ -16,6 +16,7 @@ import datetime +import warnings from oslo_utils import timeutils @@ -39,9 +40,20 @@ class AccessInfo(dict): **kwargs): """Create AccessInfo object given a successful auth response & body or a user-provided dict. + + .. warning:: + + Use of the region_name argument is deprecated as of the 1.7.0 + release and may be removed in the 2.0.0 release. + """ - # FIXME(jamielennox): Passing region_name is deprecated. Provide an - # appropriate warning. + + if region_name: + warnings.warn( + 'Use of the region_name argument is deprecated as of the ' + '1.7.0 release and may be removed in the 2.0.0 release.', + DeprecationWarning) + auth_ref = None if body is not None or len(kwargs): @@ -246,7 +258,10 @@ class AccessInfo(dict): """Returns true if the authorization token was scoped to a tenant (project), and contains a populated service catalog. - This is deprecated, use project_scoped instead. + .. warning:: + + This is deprecated as of the 1.7.0 release in favor of + project_scoped and may be removed in the 2.0.0 release. :returns: bool """ @@ -349,7 +364,8 @@ class AccessInfo(dict): (project), this property will return None. DEPRECATED: this doesn't correctly handle region name. You should fetch - it from the service catalog yourself. + it from the service catalog yourself. This may be removed in the 2.0.0 + release. :returns: tuple of urls """ @@ -362,7 +378,8 @@ class AccessInfo(dict): authentication request wasn't scoped to a tenant (project). DEPRECATED: this doesn't correctly handle region name. You should fetch - it from the service catalog yourself. + it from the service catalog yourself. This may be removed in the 2.0.0 + release. :returns: tuple of urls """ @@ -525,6 +542,13 @@ class AccessInfoV2(AccessInfo): @property def scoped(self): + """Deprecated as of the 1.7.0 release in favor of project_scoped and + may be removed in the 2.0.0 release. + """ + warnings.warn( + 'scoped is deprecated as of the 1.7.0 release in favor of ' + 'project_scoped and may be removed in the 2.0.0 release.', + DeprecationWarning) if ('serviceCatalog' in self and self['serviceCatalog'] and 'tenant' in self['token']): @@ -589,8 +613,13 @@ class AccessInfoV2(AccessInfo): @property def auth_url(self): - # FIXME(jamielennox): this is deprecated in favour of retrieving it - # from the service catalog. Provide a warning. + """Deprecated as of the 1.7.0 release in favor of + service_catalog.get_urls() and may be removed in the 2.0.0 release. + """ + warnings.warn( + 'auth_url is deprecated as of the 1.7.0 release in favor of ' + 'service_catalog.get_urls() and may be removed in the 2.0.0 ' + 'release.', DeprecationWarning) if self.service_catalog: return self.service_catalog.get_urls(service_type='identity', endpoint_type='publicURL', @@ -600,8 +629,13 @@ class AccessInfoV2(AccessInfo): @property def management_url(self): - # FIXME(jamielennox): this is deprecated in favour of retrieving it - # from the service catalog. Provide a warning. + """Deprecated as of the 1.7.0 release in favor of + service_catalog.get_urls() and may be removed in the 2.0.0 release. + """ + warnings.warn( + 'management_url is deprecated as of the 1.7.0 release in favor of ' + 'service_catalog.get_urls() and may be removed in the 2.0.0 ' + 'release.', DeprecationWarning) if self.service_catalog: return self.service_catalog.get_urls(service_type='identity', endpoint_type='adminURL', @@ -747,6 +781,13 @@ class AccessInfoV3(AccessInfo): @property def scoped(self): + """Deprecated as of the 1.7.0 release in favor of project_scoped and + may be removed in the 2.0.0 release. + """ + warnings.warn( + 'scoped is deprecated as of the 1.7.0 release in favor of ' + 'project_scoped and may be removed in the 2.0.0 release.', + DeprecationWarning) return ('catalog' in self and self['catalog'] and 'project' in self) @property @@ -775,8 +816,13 @@ class AccessInfoV3(AccessInfo): @property def auth_url(self): - # FIXME(jamielennox): this is deprecated in favour of retrieving it - # from the service catalog. Provide a warning. + """Deprecated as of the 1.7.0 release in favor of + service_catalog.get_urls() and may be removed in the 2.0.0 release. + """ + warnings.warn( + 'auth_url is deprecated as of the 1.7.0 release in favor of ' + 'service_catalog.get_urls() and may be removed in the 2.0.0 ' + 'release.', DeprecationWarning) if self.service_catalog: return self.service_catalog.get_urls(service_type='identity', endpoint_type='public', @@ -786,8 +832,13 @@ class AccessInfoV3(AccessInfo): @property def management_url(self): - # FIXME(jamielennox): this is deprecated in favour of retrieving it - # from the service catalog. Provide a warning. + """Deprecated as of the 1.7.0 release in favor of + service_catalog.get_urls() and may be removed in the 2.0.0 release. + """ + warnings.warn( + 'management_url is deprecated as of the 1.7.0 release in favor of ' + 'service_catalog.get_urls() and may be removed in the 2.0.0 ' + 'release.', DeprecationWarning) if self.service_catalog: return self.service_catalog.get_urls(service_type='identity', endpoint_type='admin', |