Make urlparse import Python3-compatible
urlparse moved to urllib.parse, so the current code fails in Python3. Using six to ensure compatibility. Related-Bug: #1426898 Change-Id: I9297c886dcc361238e942cb8162f589072001094
This commit is contained in:
parent
b0f3ed9cca
commit
2525bb98d1
|
@ -13,8 +13,8 @@
|
|||
# under the License.
|
||||
|
||||
import os
|
||||
from six.moves.urllib import parse
|
||||
import subprocess
|
||||
import urlparse
|
||||
|
||||
|
||||
CGIT_BASE = 'http://git.openstack.org/cgit/'
|
||||
|
@ -31,7 +31,7 @@ def _html_page_context(app, pagename, templatename, context, doctree):
|
|||
except subprocess.CalledProcessError:
|
||||
_cgit_link = 'unknown'
|
||||
else:
|
||||
parsed = urlparse.urlparse(git_remote)
|
||||
parsed = parse.urlparse(git_remote)
|
||||
_cgit_link = CGIT_BASE + parsed.path.lstrip('/')
|
||||
context['cgit_link'] = _cgit_link
|
||||
return context
|
||||
|
|
|
@ -4,3 +4,4 @@
|
|||
|
||||
pbr>=1.6
|
||||
requests>=2.5.2
|
||||
six>=1.9.0
|
||||
|
|
Loading…
Reference in New Issue