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:
josh7810 2016-05-04 16:26:46 -05:00
parent a0b9c2e1bd
commit b04926456a
1 changed files with 13 additions and 1 deletions

View File

@ -130,10 +130,22 @@ class MemoizedAuthServiceComposite(object):
except AttributeError:
raise MemoizedAuthServiceCompositeException(
"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(
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
def service(self):
service = self.access_data.get_service(self.service_name)