summaryrefslogtreecommitdiff
path: root/openstackclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-01-12 18:14:44 +0000
committerGerrit Code Review <review@openstack.org>2015-01-12 18:14:44 +0000
commita7a1a576e0ee136f238f6be104708bcad530daca (patch)
tree9941b2a2707220cad59964dd2f45512ae104375a /openstackclient
parente01df5eb287e892958463b5e525972a07db10edc (diff)
parenta8f60a8aa1c8cbbf0d1384131854a422705e7c78 (diff)
downloadpython-openstackclient-a7a1a576e0ee136f238f6be104708bcad530daca.tar.gz
Merge "fix some small issues in catalog show"
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/identity/v2_0/catalog.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/openstackclient/identity/v2_0/catalog.py b/openstackclient/identity/v2_0/catalog.py
index 1a96fdf6..dfc99b47 100644
--- a/openstackclient/identity/v2_0/catalog.py
+++ b/openstackclient/identity/v2_0/catalog.py
@@ -83,17 +83,12 @@ class ShowCatalog(show.ShowOne):
data = None
for service in sc.get_data():
- if (
- 'name' in service and
- service['name'] != parsed_args.service and
- 'type' in service and
- service['type'] != parsed_args.service
- ):
- continue
-
- data = service
- data['endpoints'] = _format_endpoints(data['endpoints'])
- if 'endpoints_links' in data:
- data.pop('endpoints_links')
+ if (service.get('name') == parsed_args.service or
+ service.get('type') == parsed_args.service):
+ data = service
+ data['endpoints'] = _format_endpoints(data['endpoints'])
+ if 'endpoints_links' in data:
+ data.pop('endpoints_links')
+ break
return zip(*sorted(six.iteritems(data)))