diff options
author | Dolph Mathews <dolph.mathews@gmail.com> | 2012-10-09 03:58:33 +0000 |
---|---|---|
committer | Dolph Mathews <dolph.mathews@gmail.com> | 2012-10-11 16:02:30 +0000 |
commit | b94c6c063ef802abd42678b7a1725102762a5acb (patch) | |
tree | cd589b2602b32afc5fb111a87b4b06b0c09b1656 /keystoneclient/service_catalog.py | |
parent | 6a99409a0da5328f3c766e5a392a99ecda86f0cd (diff) | |
download | python-keystoneclient-b94c6c063ef802abd42678b7a1725102762a5acb.tar.gz |
Useful error msg when missing catalog (bug 949904)
Change-Id: I498e9b79e9739437b7e61997b37e84283b496561
Diffstat (limited to 'keystoneclient/service_catalog.py')
-rw-r--r-- | keystoneclient/service_catalog.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/keystoneclient/service_catalog.py b/keystoneclient/service_catalog.py index faff74b..5f20e0f 100644 --- a/keystoneclient/service_catalog.py +++ b/keystoneclient/service_catalog.py @@ -27,7 +27,16 @@ class ServiceCatalog(object): self.catalog = resource_dict def get_token(self): - """Fetch token details fron service catalog""" + """Fetch token details fron service catalog. + + Returns a dictionary containing the following:: + + - `id`: Token's ID + - `expires`: Token's expiration + - `user_id`: Authenticated user's ID + - `tenant_id`: Authorized project's ID + + """ token = {'id': self.catalog['token']['id'], 'expires': self.catalog['token']['expires']} try: @@ -46,6 +55,8 @@ class ServiceCatalog(object): a particular endpoint attribute. If no attribute is given, return the first endpoint of the specified type. + Valid endpoint types: `publicURL`, `internalURL`, `adminURL` + See tests for a sample service catalog. """ catalog = self.catalog.get('serviceCatalog', []) @@ -62,7 +73,7 @@ class ServiceCatalog(object): raise exceptions.EndpointNotFound('Endpoint not found.') def get_endpoints(self, service_type=None, endpoint_type=None): - """Fetch and filter endpoints for the specified service(s) + """Fetch and filter endpoints for the specified service(s). Returns endpoints for the specified service (or all) and that contain the specified type (or all). |