Pretty print of endpoints for ambiguous error
Pretty print the list of endpoints by region for ambigous endpoint error Change-Id: Ia99b6d46b1944db631fc4bd446aeae77abb08262 Closes-Bug: #1241177
This commit is contained in:
parent
6fd8d8e12e
commit
7f56f0a8c3
@ -79,7 +79,10 @@ class ServiceCatalog(object):
|
||||
if not matching_endpoints:
|
||||
raise cinderclient.exceptions.EndpointNotFound()
|
||||
elif len(matching_endpoints) > 1:
|
||||
raise cinderclient.exceptions.AmbiguousEndpoints(
|
||||
endpoints=matching_endpoints)
|
||||
try:
|
||||
eplist = [ep[attr] for ep in matching_endpoints]
|
||||
except KeyError:
|
||||
eplist = matching_endpoints
|
||||
raise cinderclient.exceptions.AmbiguousEndpoints(endpoints=eplist)
|
||||
else:
|
||||
return matching_endpoints[0][endpoint_type]
|
||||
|
Loading…
x
Reference in New Issue
Block a user