Add accessor method for raw catalog content

There are cases, such as os_auth in ansible, where a user wants to
be able to get at the raw catalog content. This is often extremely
useful when debugging cloud applications.

Change-Id: Ibe51b5f1a4b1d93efb6076b5f97b0fd10376cd16
Monty Taylor 2015-09-02 16:04:10 -04:00 committed by Jamie Lennox
parent 35113c7854
commit 78c7d6448c
1 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,16 @@ class ServiceCatalog(object):
def _get_endpoint_region(self, endpoint):
return endpoint.get('region_id') or endpoint.get('region')
def catalog(self):
"""Return the raw service catalog content, mostly useful for debugging.
Applications should avoid this and use accessor methods instead.
However, there are times when inspecting the raw catalog can be useful
for analysis and other reasons.
return self._catalog
def is_interface_match(self, endpoint, interface):
"""Helper function to normalize endpoint matching across v2 and v3.