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:
parent
4279fd253b
commit
08d581fd5c
@ -45,6 +45,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import unittest
|
import unittest
|
||||||
|
import six
|
||||||
import sys
|
import sys
|
||||||
import proboscis
|
import proboscis
|
||||||
|
|
||||||
@ -73,7 +74,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')
|
||||||
|
|
||||||
|
|
||||||
MAIN_RUNNER = None
|
MAIN_RUNNER = None
|
||||||
|
@ -59,10 +59,14 @@ import heapq
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
import six
|
||||||
import sys
|
import sys
|
||||||
import time
|
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 config
|
||||||
from nose import core
|
from nose import core
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
|
|
||||||
|
|
||||||
def initialize(extra_opts=None, pre_logging=None):
|
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
|
# Import only the modules necessary to initialize logging and determine if
|
||||||
# debug_utils are enabled.
|
# debug_utils are enabled.
|
||||||
import sys
|
import sys
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import gettext
|
|
||||||
gettext.install('trove', unicode=1)
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_config import cfg as openstack_cfg
|
from oslo_config import cfg as openstack_cfg
|
||||||
|
@ -13,14 +13,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import gettext
|
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
gettext.install('trove', unicode=1)
|
|
||||||
|
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from trove.common import cfg
|
from trove.common import cfg
|
||||||
|
Loading…
Reference in New Issue
Block a user