Keep py3.X compatibility for urllib

Change-Id: I0bdf317d29cd83ad1ef9aec3b1646e84df2660de
This commit is contained in:
Swapnil Kulkarni (coolsvap) 2015-12-23 09:17:00 +05:30
parent 5ae46608b0
commit f87d69c497
3 changed files with 6 additions and 4 deletions

View File

@ -3,3 +3,4 @@
# Not currently needed for anything else. # Not currently needed for anything else.
pydot2>=1.0.32 pydot2>=1.0.32
PyYAML>=3.1.0 PyYAML>=3.1.0
six>=1.9.0

View File

@ -11,10 +11,11 @@
# under the License. # under the License.
import json import json
import urllib
import requests import requests
from six.moves.urllib import parse
import base import base
# Specify stable branch to look for. Some repos contain stable branches # Specify stable branch to look for. Some repos contain stable branches
@ -29,7 +30,7 @@ class ValidateStableBranches(base.ValidatorBase):
def has_stable_branch(repo): def has_stable_branch(repo):
response = requests.get( response = requests.get(
'https://review.openstack.org:443/projects/%s/branches' % 'https://review.openstack.org:443/projects/%s/branches' %
urllib.quote_plus(repo)) parse.quote_plus(repo))
# strip off first few chars because 'the JSON response body starts with # strip off first few chars because 'the JSON response body starts with
# a magic prefix line that must be stripped before feeding the rest of # a magic prefix line that must be stripped before feeding the rest of
# the response body to a JSON parser' # the response body to a JSON parser'

View File

@ -29,8 +29,8 @@ import yaml
import os import os
import sys import sys
import urllib
from six.moves.urllib import parse
# List of modules to validate team based tags # List of modules to validate team based tags
team_validators = [ team_validators = [
teamstats.ValidateDiversity, teamstats.ValidateDiversity,
@ -78,7 +78,7 @@ def repo_exists(repo):
"""Sometimes the governance docs can get out of sync with repo names.""" """Sometimes the governance docs can get out of sync with repo names."""
response = requests.get( response = requests.get(
'https://review.openstack.org:443/projects/%s/' % 'https://review.openstack.org:443/projects/%s/' %
urllib.quote_plus(repo)) parse.quote_plus(repo))
# strip off first few chars because 'the JSON response body starts with # strip off first few chars because 'the JSON response body starts with
# a magic prefix line that must be stripped before feeding the rest of # a magic prefix line that must be stripped before feeding the rest of
# the response body to a JSON parser' # the response body to a JSON parser'