Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
fix bug:endpoint获取处理阶段,使用region信息判断正确的url
Browse files Browse the repository at this point in the history
  • Loading branch information
karonganyong committed Sep 30, 2019
1 parent 9cf982d commit 89fe0dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions openstack/aksksession.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,16 @@ def __fetch_all_endpoint_service(self):
for endpoint, service in lzip(endpoints, services):
if endpoint and endpoint.get("enabled"):
id_endpoint_map.setdefault(endpoint.get("service_id"), [])
id_endpoint_map[endpoint.get("service_id")].append(endpoint.get("url"))
data_map = {endpoint.get("region"): endpoint.get("url")}
id_endpoint_map[endpoint.get("service_id")].append(data_map)
if service and service.get("enabled"):
servicetype_id_map.setdefault(service.get("type"), [])
servicetype_id_map[service.get("type")].append(service.get("id"))
for k, v in servicetype_id_map.items():
for serviceid in v:
for url in id_endpoint_map.get(serviceid, []):
if self.region in url:
for region_url_map in id_endpoint_map.get(serviceid, []):
url = region_url_map.get(self.region, "")
if url != "":
kvendpoints[k] = url.replace("$(tenant_id)s", self.project_id)
break
if kvendpoints.get(k, ""):
Expand Down

0 comments on commit 89fe0dd

Please sign in to comment.