Merge "Fix an encoding exception when creating a public_url"

This commit is contained in:
Jenkins 2014-10-16 07:22:14 +00:00 committed by Gerrit Code Review
commit 79df5b42ed
1 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,8 @@ def swift_get_container(request, container_name, with_data=True):
swift_endpoint = base.url_for(request,
'object-store',
endpoint_type='publicURL')
public_url = swift_endpoint + '/' + urlparse.quote(container_name)
parameters = urlparse.quote(container_name.encode('utf8'))
public_url = swift_endpoint + '/' + parameters
ts_float = float(headers.get('x-timestamp'))
timestamp = timeutils.iso8601_from_timestamp(ts_float)
except Exception: