Allow handling multiple service_types
If the same service_type was mentioned in the catalog more than once then only the last entry would be parsed and any possible other matches would be lost. This was something that novaclient used to do, and as we are pushing sessions as the way that clients should all work we need to maintain that compatibility. Change-Id: I6964515ed1975bce1998897abfc02a1ec36e2584 Closes-Bug: #1425766
This commit is contained in:
parent
195d5214b0
commit
e2dad7d82c
|
@ -127,7 +127,7 @@ class ServiceCatalog(object):
|
|||
if service_name != sn:
|
||||
continue
|
||||
|
||||
sc[st] = []
|
||||
endpoints = sc.setdefault(st, [])
|
||||
|
||||
for endpoint in service.get('endpoints', []):
|
||||
if (endpoint_type and not
|
||||
|
@ -136,7 +136,7 @@ class ServiceCatalog(object):
|
|||
if (region_name and
|
||||
region_name != self._get_endpoint_region(endpoint)):
|
||||
continue
|
||||
sc[st].append(endpoint)
|
||||
endpoints.append(endpoint)
|
||||
|
||||
return sc
|
||||
|
||||
|
|
Loading…
Reference in New Issue