fix some small issues in catalog show
I think there are three issues we should fix: 1. wrong indentation of 'continue' 2. currently, name is optional for service, but according to the currrent logic, if a service doesn't have name attribute we will select it anyway 3. we always loop all catalogs Change-Id: I9fce66677affa396b6a12afea76e87cab9215a58
This commit is contained in:
parent
d2943d2592
commit
a8f60a8aa1
@ -83,17 +83,12 @@ class ShowCatalog(show.ShowOne):
|
|||||||
|
|
||||||
data = None
|
data = None
|
||||||
for service in sc.get_data():
|
for service in sc.get_data():
|
||||||
if (
|
if (service.get('name') == parsed_args.service or
|
||||||
'name' in service and
|
service.get('type') == parsed_args.service):
|
||||||
service['name'] != parsed_args.service and
|
data = service
|
||||||
'type' in service and
|
data['endpoints'] = _format_endpoints(data['endpoints'])
|
||||||
service['type'] != parsed_args.service
|
if 'endpoints_links' in data:
|
||||||
):
|
data.pop('endpoints_links')
|
||||||
continue
|
break
|
||||||
|
|
||||||
data = service
|
|
||||||
data['endpoints'] = _format_endpoints(data['endpoints'])
|
|
||||||
if 'endpoints_links' in data:
|
|
||||||
data.pop('endpoints_links')
|
|
||||||
|
|
||||||
return zip(*sorted(six.iteritems(data)))
|
return zip(*sorted(six.iteritems(data)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user