Merge "feat: Add swift endpoint url when generate nginx.conf"

This commit is contained in:
Zuul 2021-11-29 03:49:01 +00:00 committed by Gerrit Code Review
commit 70babad06a
3 changed files with 8 additions and 1 deletions

View File

@ -76,6 +76,7 @@ openstack:
image: glance
load-balancer: octavia
network: neutron
object-store: swift
orchestration: heat
placement: placement
volumev3: cinder

View File

@ -174,6 +174,7 @@ service_mapping = Opt(
"placement": "placement",
"baremetal": "ironic",
"load-balancer": "octavia",
"object-store": "swift",
},
)

View File

@ -91,7 +91,12 @@ def get_proxy_endpoints() -> Dict[str, ProxyEndpoint]:
if raw_url.path:
raw_path = PurePath(raw_url.path)
if len(raw_path.parts) > 1:
if raw_path.match("%(tenant_id)s") or raw_path.match("$(project_id)s"):
if (
raw_path.match("%(tenant_id)s")
or raw_path.match("AUTH_%(tenant_id)s")
or raw_path.match("$(project_id)s")
or raw_path.match("AUTH_$(project_id)s")
):
path = "" if str(raw_path.parents[1]) == "/" else raw_path.parents[1]
elif raw_path.match("v[0-9]") or raw_path.match("v[0-9][.][0-9]"):
path = "" if str(raw_path.parents[0]) == "/" else raw_path.parents[0]