Use six.moves.http_client instead of httplib
The httplib module has been renamed to http.client in Python 3. We can use six.moves.http_client to let it support Python 3. See http://docs.python.org/2/library/httplib.html#module-httplib Part of blueprint py33 Change-Id: I860446d808b182852edad205f4e0cde586a864aa
This commit is contained in:
committed by
Gerrit Code Review
parent
94d91e6e06
commit
1439624aa4
@@ -13,8 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import httplib
|
from six.moves import http_client
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from stackalytics.openstack.common import log as logging
|
from stackalytics.openstack.common import log as logging
|
||||||
@@ -43,7 +42,7 @@ def lp_profile_by_email(email):
|
|||||||
def lp_module_exists(module):
|
def lp_module_exists(module):
|
||||||
uri = LP_URI_DEVEL % module
|
uri = LP_URI_DEVEL % module
|
||||||
parsed_uri = parse.urlparse(uri)
|
parsed_uri = parse.urlparse(uri)
|
||||||
conn = httplib.HTTPConnection(parsed_uri.netloc)
|
conn = http_client.HTTPConnection(parsed_uri.netloc)
|
||||||
conn.request('GET', parsed_uri.path)
|
conn.request('GET', parsed_uri.path)
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
LOG.debug('Checked uri: %(uri)s, status: %(status)s',
|
LOG.debug('Checked uri: %(uri)s, status: %(status)s',
|
||||||
|
|||||||
@@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
from email import utils as email_utils
|
from email import utils as email_utils
|
||||||
import gzip
|
import gzip
|
||||||
import httplib
|
|
||||||
import re
|
import re
|
||||||
import StringIO
|
import StringIO
|
||||||
|
|
||||||
import six
|
import six
|
||||||
|
from six.moves import http_client
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from stackalytics.openstack.common import log as logging
|
from stackalytics.openstack.common import log as logging
|
||||||
@@ -65,7 +65,7 @@ def _get_mail_archive_links(uri):
|
|||||||
def _link_content_changed(link, runtime_storage_inst):
|
def _link_content_changed(link, runtime_storage_inst):
|
||||||
LOG.debug('Check changes for mail archive located at uri: %s', link)
|
LOG.debug('Check changes for mail archive located at uri: %s', link)
|
||||||
parsed_uri = parse.urlparse(link)
|
parsed_uri = parse.urlparse(link)
|
||||||
conn = httplib.HTTPConnection(parsed_uri.netloc)
|
conn = http_client.HTTPConnection(parsed_uri.netloc)
|
||||||
conn.request('HEAD', parsed_uri.path)
|
conn.request('HEAD', parsed_uri.path)
|
||||||
res = conn.getresponse()
|
res = conn.getresponse()
|
||||||
last_modified = res.getheader('last-modified')
|
last_modified = res.getheader('last-modified')
|
||||||
|
|||||||
Reference in New Issue
Block a user