Comment 2 for bug 1610138

Revision history for this message
XiaodongPan (xdongp) wrote :

I have find the reason of this bug, In the source file "master/keystone/token/providers/common.py", the function of "format_catalog", as below:
==============================
        for region, region_ref in catalog_ref.items():
            for service, service_ref in region_ref.items():
                new_service_ref = services.get(service, {})
                new_service_ref['name'] = service_ref.pop('name')
                new_service_ref['type'] = service
                new_service_ref['endpoints_links'] = []
                service_ref['region'] = region

                endpoints_ref = new_service_ref.get('endpoints', [])
                endpoints_ref.append(service_ref)

                new_service_ref['endpoints'] = endpoints_ref
                services[service] = new_service_ref

        return list(services.values())
===========================================
In the loop, the services dict use service type as key, when the type name are the same, but the service name are not the same, ex: region1: type=volume, name=cinder; region2: type=volume, name=cinder1. then the dict of services use "volume" as key, the last item will overwrite the previous value.