Merge "Port run_tests.py to Python 3"

This commit is contained in:
Jenkins 2015-12-02 00:22:12 +00:00 committed by Gerrit Code Review
commit d2a4f3e6cb
2 changed files with 8 additions and 4 deletions

View File

@ -21,11 +21,12 @@ import gettext
import os import os
import sys import sys
import traceback import traceback
import urllib
import eventlet import eventlet
from oslo_log import log as logging from oslo_log import log as logging
import proboscis import proboscis
import six
from six.moves import urllib
import wsgi_intercept import wsgi_intercept
from wsgi_intercept.httplib2_intercept import install as wsgi_install from wsgi_intercept.httplib2_intercept import install as wsgi_install
@ -56,7 +57,10 @@ def add_support_for_localization():
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
sys.path.insert(0, possible_topdir) sys.path.insert(0, possible_topdir)
gettext.install('nova', unicode=1) if six.PY2:
gettext.install('nova', unicode=1)
else:
gettext.install('nova')
def initialize_trove(config_file): def initialize_trove(config_file):
@ -146,7 +150,7 @@ def initialize_fakes(app):
def call_back(env, start_response): def call_back(env, start_response):
path_info = env.get('PATH_INFO') path_info = env.get('PATH_INFO')
if path_info: if path_info:
env['PATH_INFO'] = urllib.unquote(path_info) env['PATH_INFO'] = urllib.parse.unquote(path_info)
return app.__call__(env, start_response) return app.__call__(env, start_response)
return call_back return call_back

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py27,pep8,checkbuild,checklinks envlist = py34,py27,pep8,checkbuild,checklinks
minversion = 1.6 minversion = 1.6
skipsdist = True skipsdist = True