summaryrefslogtreecommitdiff
path: root/glanceclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-08-18 12:40:32 +0000
committerGerrit Code Review <review@openstack.org>2014-08-18 12:40:32 +0000
commitfa6eca864553e70b80b8680b9616201adc54a16b (patch)
treef8b94118166940db8c3c047ffe2002f26050a3fb /glanceclient
parent1dfce5301c5d7cd456c98629a007917120637c8a (diff)
parent867e4cae27afbd7e21d37a79e77f2787b061ec03 (diff)
downloadpython-glanceclient-fa6eca864553e70b80b8680b9616201adc54a16b.tar.gz
Merge "Normalize glanceclient requested service url"
Diffstat (limited to 'glanceclient')
-rw-r--r--glanceclient/common/http.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py
index ad8e4c7..874f2f4 100644
--- a/glanceclient/common/http.py
+++ b/glanceclient/common/http.py
@@ -97,8 +97,6 @@ class HTTPClient(object):
if data and isinstance(data, six.string_types):
curl.append('-d \'%s\'' % data)
- if "//:" not in url:
- url = '%s%s' % (self.endpoint, url)
curl.append(url)
LOG.debug(strutils.safe_encode(' '.join(curl), errors='ignore'))
@@ -168,7 +166,10 @@ class HTTPClient(object):
headers = self.encode_headers(headers)
try:
- conn_url = "%s/%s" % (self.endpoint, url)
+ if self.endpoint.endswith("/") or url.startswith("/"):
+ conn_url = "%s%s" % (self.endpoint, url)
+ else:
+ conn_url = "%s/%s" % (self.endpoint, url)
self.log_curl_request(method, conn_url, headers, data, kwargs)
resp = self.session.request(method,
conn_url,