Keep py3.X compatibility for urllib

Use six.moves.urllib.parse instead of urllib

Partial-Bug: #1280105

Change-Id: Ie10e9fd8ff42b65b1610839eaeee09e3c56f2de7
This commit is contained in:
Fengqian Gao 2014-02-18 12:57:30 +08:00
parent 9133f5ad63
commit b7d5a6e749
1 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,8 @@
# under the License.
import logging
import urllib
import six.moves.urllib.parse as urlparse
import swiftclient
from django.conf import settings
@ -163,7 +163,7 @@ 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 + '/' + urllib.quote(container_name)
public_url = swift_endpoint + '/' + urlparse.quote(container_name)
ts_float = float(headers.get('x-timestamp'))
timestamp = timeutils.iso8601_from_timestamp(ts_float)
except Exception: