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:
Jamie Lennox 2015-02-26 12:07:11 +11:00
parent 195d5214b0
commit e2dad7d82c
1 changed files with 2 additions and 2 deletions

View File

@ -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