Merge "Pretty print of endpoints for ambiguous error"
This commit is contained in:
@@ -79,7 +79,10 @@ class ServiceCatalog(object):
|
|||||||
if not matching_endpoints:
|
if not matching_endpoints:
|
||||||
raise cinderclient.exceptions.EndpointNotFound()
|
raise cinderclient.exceptions.EndpointNotFound()
|
||||||
elif len(matching_endpoints) > 1:
|
elif len(matching_endpoints) > 1:
|
||||||
raise cinderclient.exceptions.AmbiguousEndpoints(
|
try:
|
||||||
endpoints=matching_endpoints)
|
eplist = [ep[attr] for ep in matching_endpoints]
|
||||||
|
except KeyError:
|
||||||
|
eplist = matching_endpoints
|
||||||
|
raise cinderclient.exceptions.AmbiguousEndpoints(endpoints=eplist)
|
||||||
else:
|
else:
|
||||||
return matching_endpoints[0][endpoint_type]
|
return matching_endpoints[0][endpoint_type]
|
||||||
|
|||||||
Reference in New Issue
Block a user