py3.x: Fix usage of gettext.install

This needed to be updated to get py3.x to work.

Change-Id: I987854c0266566e1e7722478dbb3e27bcffbb08b
Closes-Bug: #1777440
This commit is contained in:
Corey Bryant 2018-06-18 09:10:57 -04:00
parent 4279fd253b
commit 08d581fd5c
5 changed files with 10 additions and 14 deletions

View File

@ -45,6 +45,7 @@ import logging
import os
import time
import unittest
import six
import sys
import proboscis
@ -73,7 +74,10 @@ def add_support_for_localization():
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
sys.path.insert(0, possible_topdir)
gettext.install('nova', unicode=1)
if six.PY2:
gettext.install('nova', unicode=1)
else:
gettext.install('nova')
MAIN_RUNNER = None

View File

@ -59,10 +59,14 @@ import heapq
import logging
import os
import unittest
import six
import sys
import time
gettext.install('nova', unicode=1)
if six.PY2:
gettext.install('nova', unicode=1)
else:
gettext.install('nova')
from nose import config
from nose import core

View File

@ -15,10 +15,6 @@
def initialize(extra_opts=None, pre_logging=None):
# Initialize localization support (the underscore character).
import gettext
gettext.install('trove', unicode=1)
# Import only the modules necessary to initialize logging and determine if
# debug_utils are enabled.
import sys

View File

@ -13,9 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import gettext
gettext.install('trove', unicode=1)
import sys
from oslo_config import cfg as openstack_cfg

View File

@ -13,14 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import gettext
import inspect
import sys
gettext.install('trove', unicode=1)
from oslo_log import log as logging
from trove.common import cfg