diff options
author | Gabriel Hurley <gabriel@strikeawe.com> | 2012-10-23 11:27:43 -0700 |
---|---|---|
committer | Gabriel Hurley <gabriel@strikeawe.com> | 2012-10-23 11:27:43 -0700 |
commit | 0dfc69806d3767a7f6be91d9df18f20d31866c91 (patch) | |
tree | 03e48b04dc2817bcbdd3f6332371d19806355069 /keystoneclient/service_catalog.py | |
parent | e04b0e16ae4ef3c63cedf05979cca93595f34f28 (diff) | |
download | python-keystoneclient-0dfc69806d3767a7f6be91d9df18f20d31866c91.tar.gz |
Don't log an exception for an expected empty catalog.
Cleans up the code around exception handling and logging
when first authenticating (which often returns an unscoped token).
There's no need to be logging an exception on an expected empty
catalog and moreover the except block was a bare "except" which
could mask other errors.
Fixes bug 1070493
Change-Id: I5e791e95ce3f9ab77723a7f4698cb11b169dacfb
Diffstat (limited to 'keystoneclient/service_catalog.py')
-rw-r--r-- | keystoneclient/service_catalog.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/keystoneclient/service_catalog.py b/keystoneclient/service_catalog.py index 5f20e0f..cbe5c5d 100644 --- a/keystoneclient/service_catalog.py +++ b/keystoneclient/service_catalog.py @@ -61,6 +61,9 @@ class ServiceCatalog(object): """ catalog = self.catalog.get('serviceCatalog', []) + if not catalog: + raise exceptions.EmptyCatalog('The service catalog is empty.') + for service in catalog: if service['type'] != service_type: continue |