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
Javier Pena
8 years ago
12 | 12 | # under the License. |
13 | 13 | |
14 | 14 | import os |
15 | from six.moves.urllib import parse | |
15 | 16 | import subprocess |
16 | import urlparse | |
17 | 17 | |
18 | 18 | |
19 | 19 | CGIT_BASE = 'http://git.openstack.org/cgit/' |
30 | 30 | except subprocess.CalledProcessError: |
31 | 31 | _cgit_link = 'unknown' |
32 | 32 | else: |
33 | parsed = urlparse.urlparse(git_remote) | |
33 | parsed = parse.urlparse(git_remote) | |
34 | 34 | _cgit_link = CGIT_BASE + parsed.path.lstrip('/') |
35 | 35 | context['cgit_link'] = _cgit_link |
36 | 36 | return context |