From e32a00dc32b5feaac210439e2e5ecb2b84d9a22d Mon Sep 17 00:00:00 2001 From: liyingjun Date: Thu, 13 Feb 2014 02:42:51 +0800 Subject: [PATCH] Fix endpoint error when running keystone on apache When running keystone in httpd, horizon could not generate the right keystone endpoint url. Fixes this issue by retrieving the whole path from the service_catalog or OPENSTACK_KEYSTONE_URL and generating a new url. Change-Id: Id8459947498127e47700d9f690d4ed4d5cadbba9 Closes-bug: #1295128 (cherry picked from commit 48a0d07e45bac04393978776c63b67cd7c71415d) --- openstack_dashboard/api/keystone.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index 636e4cb660..2d375ee199 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -113,9 +113,8 @@ def _get_endpoint_url(request, endpoint_type, catalog=None): # TODO(gabriel): When the Service Catalog no longer contains API versions # in the endpoints this can be removed. - bits = urlparse.urlparse(url) - root = "://".join((bits.scheme, bits.netloc)) - url = "%s/v%s" % (root, VERSIONS.active) + url = url.rstrip('/') + url = urlparse.urljoin(url, 'v%s' % VERSIONS.active) return url