mirror of
https://github.com/ceph/ceph
synced 2024-12-28 14:34:13 +00:00
Merge pull request #20229 from zhsj/fix-dashboard-prefix
pybind/mgr/dashboard: fix duplicated slash in html href Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
66c7832c33
@ -71,10 +71,11 @@ def to_sorted_array(data):
|
||||
return sorted(data.iteritems())
|
||||
|
||||
def prepare_url_prefix(url_prefix):
|
||||
"""
|
||||
return '' if no prefix, or '/prefix' without slash in the end.
|
||||
"""
|
||||
url_prefix = urlparse.urljoin('/', url_prefix)
|
||||
if url_prefix[-1] != '/':
|
||||
url_prefix = url_prefix + '/'
|
||||
return url_prefix
|
||||
return url_prefix.rstrip('/')
|
||||
|
||||
class StandbyModule(MgrStandbyModule):
|
||||
def serve(self):
|
||||
@ -1012,7 +1013,7 @@ class Module(MgrModule):
|
||||
|
||||
# Publish the URI that others may use to access the service we're
|
||||
# about to start serving
|
||||
self.set_uri("http://{0}:{1}{2}".format(
|
||||
self.set_uri("http://{0}:{1}{2}/".format(
|
||||
socket.getfqdn() if server_addr == "::" else server_addr,
|
||||
server_port,
|
||||
url_prefix
|
||||
|
Loading…
Reference in New Issue
Block a user