Add internal_url property to Auth Provider
* Added an internal_url property to the auth provider so that clients can access this to test over snet. * Fixed a minor typo in the Exception message of public_url property. Change-Id: I0faebbbad995bb453e25e5285aa492265859ae7a
This commit is contained in:
parent
a0b9c2e1bd
commit
b04926456a
|
@ -130,10 +130,22 @@ class MemoizedAuthServiceComposite(object):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise MemoizedAuthServiceCompositeException(
|
raise MemoizedAuthServiceCompositeException(
|
||||||
"Unable to locate an endpoint with the region '{0}' in the "
|
"Unable to locate an endpoint with the region '{0}' in the "
|
||||||
"service '{1}' from the service service catalog for user {2}. "
|
"service '{1}' from the service catalog for user {2}. "
|
||||||
"No public URL found.".format(
|
"No public URL found.".format(
|
||||||
self.region, self.service_name, self.tenant_id))
|
self.region, self.service_name, self.tenant_id))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def internal_url(self):
|
||||||
|
endpoint = self.service.get_endpoint(self.region)
|
||||||
|
try:
|
||||||
|
return endpoint.internal_url
|
||||||
|
except AttributeError:
|
||||||
|
raise MemoizedAuthServiceCompositeException(
|
||||||
|
"Unable to locate an endpoint with the region '{0}' in the "
|
||||||
|
"service '{1}' from the service catalog for user {2}. "
|
||||||
|
"No internal_url URL found.".format(
|
||||||
|
self.region, self.service_name, self.tenant_id))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def service(self):
|
def service(self):
|
||||||
service = self.access_data.get_service(self.service_name)
|
service = self.access_data.get_service(self.service_name)
|
||||||
|
|
Loading…
Reference in New Issue