Browse Source

Keep py3.X compatibility for urllib

Use six.moves.urllib.parse instead of urllib

Partial-Bug: #1280105

Change-Id: Ie10e9fd8ff42b65b1610839eaeee09e3c56f2de7
tags/2014.1.b3
Fengqian Gao 6 years ago
parent
commit
b7d5a6e749
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      openstack_dashboard/api/swift.py

+ 2
- 2
openstack_dashboard/api/swift.py 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:

Loading…
Cancel
Save