Port to use oslo.i18n

Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.

Change-Id: I9bfe95c7995c47715151386c602ef954499bb2ea
This commit is contained in:
liyingjun 2014-10-14 20:27:27 +08:00 committed by Andrey Kurilin
parent efd3f75573
commit 9089ea4e56
37 changed files with 70 additions and 35 deletions

View File

@ -3,7 +3,6 @@
# The list of modules to copy from oslo-incubator.git
module=cliutils
module=config
module=gettextutils
module=log
module=test
module=fixture

View File

@ -19,7 +19,7 @@ import six
from rally.benchmark.context import base
from rally.benchmark.context.cleanup import utils
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils as rutils

View File

@ -19,7 +19,7 @@ import six
from rally.benchmark.context import base
from rally.benchmark.context.cleanup import utils
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils as rutils

View File

@ -17,7 +17,7 @@ import novaclient.exceptions
import six
from rally.benchmark.context import base
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils

View File

@ -18,7 +18,7 @@ from rally.benchmark.context.quotas import cinder_quotas
from rally.benchmark.context.quotas import designate_quotas
from rally.benchmark.context.quotas import neutron_quotas
from rally.benchmark.context.quotas import nova_quotas
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils

View File

@ -15,7 +15,7 @@
from rally.benchmark.context import base
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils as rutils

View File

@ -14,7 +14,7 @@
# under the License.
from rally.benchmark.context import base
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils

View File

@ -20,7 +20,7 @@ import tempfile
from rally.benchmark.context import base
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import utils
from rally.verification.verifiers.tempest import config

View File

@ -19,8 +19,8 @@ from rally.benchmark.context import base
from rally.benchmark import utils
from rally.benchmark.wrappers import keystone
from rally import consts
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common.gettextutils import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils as rutils

View File

@ -28,8 +28,8 @@ from rally.benchmark.scenarios import base as base_scenario
from rally.benchmark.sla import base as base_sla
from rally import consts
from rally import exceptions
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common.gettextutils import _
from rally.openstack.common import log as logging
from rally import osclients
from rally import utils as rutils

View File

@ -14,7 +14,7 @@ import requests
from rally.benchmark.scenarios import base
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
class WrongStatusException(exceptions.RallyException):

View File

@ -21,7 +21,7 @@ import tempfile
import six
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
class TempestBenchmarkFailure(exceptions.RallyException):

View File

@ -25,7 +25,7 @@ import jsonschema
import six
from rally.benchmark.processing import utils as putils
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally import utils

View File

@ -22,8 +22,8 @@ from novaclient import exceptions as nova_exc
from rally.benchmark import types as types
from rally import consts
from rally import exceptions
from rally.i18n import _
from rally import objects
from rally.openstack.common.gettextutils import _
from rally.verification.verifiers.tempest import tempest

View File

@ -23,7 +23,7 @@ from wsgiref import simple_server
from oslo.config import cfg
from rally.aas.rest import app as rally_app
from rally.openstack.common.gettextutils import _ # noqa
from rally.i18n import _
from rally.openstack.common import log

View File

@ -21,9 +21,9 @@ import sys
from oslo.config import cfg
from rally.i18n import _
from rally.openstack.common.apiclient import exceptions
from rally.openstack.common import cliutils
from rally.openstack.common.gettextutils import _
from rally.openstack.common import log as logging
from rally import utils
from rally import version

View File

@ -30,9 +30,9 @@ from rally.cmd.commands import use
from rally.cmd import envutils
from rally import db
from rally import exceptions
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common import cliutils as common_cliutils
from rally.openstack.common.gettextutils import _
from rally.orchestrator import api
from rally import osclients
from rally import utils

View File

@ -21,9 +21,9 @@ from rally.cmd import cliutils
from rally.cmd import envutils
from rally import db
from rally import exceptions
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common import cliutils as common_cliutils
from rally.openstack.common.gettextutils import _
from rally import osclients
from rally import utils

View File

@ -31,8 +31,8 @@ from rally.cmd.commands import use
from rally.cmd import envutils
from rally import db
from rally import exceptions
from rally.i18n import _
from rally.openstack.common import cliutils as common_cliutils
from rally.openstack.common.gettextutils import _
from rally.orchestrator import api
from rally import utils as rutils

View File

@ -26,9 +26,9 @@ from rally.cmd import envutils
from rally import consts
from rally import db
from rally import exceptions
from rally.i18n import _
from rally import objects
from rally.openstack.common import cliutils as common_cliutils
from rally.openstack.common.gettextutils import _
from rally.orchestrator import api
from rally.verification.verifiers.tempest import json2html

View File

@ -19,7 +19,7 @@ import decorator
from rally import exceptions
from rally import fileutils
from rally.openstack.common.gettextutils import _
from rally.i18n import _
ENV_DEPLOYMENT = 'RALLY_DEPLOYMENT'
ENV_TASK = 'RALLY_TASK'

View File

@ -25,7 +25,7 @@ from sqlalchemy.orm.exc import NoResultFound
from rally.db.sqlalchemy import models
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
CONF = cfg.CONF

View File

@ -21,7 +21,7 @@ import six
from rally import consts
from rally.deploy.serverprovider import provider
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import utils

View File

@ -18,8 +18,8 @@ import os
from rally import consts
from rally.deploy import engine
from rally.deploy.serverprovider import provider
from rally.i18n import _
from rally import objects
from rally.openstack.common.gettextutils import _
from rally.openstack.common import log as logging
from rally import utils

View File

@ -17,8 +17,8 @@ from rally import consts
from rally.deploy import engine
from rally.deploy.fuel import fuelclient
from rally import exceptions
from rally.i18n import _
from rally import objects
from rally.openstack.common.gettextutils import _ # noqa
FILTER_SCHEMA = {

View File

@ -21,8 +21,8 @@ from rally.deploy import engine
from rally.deploy.serverprovider import provider
from rally.deploy.serverprovider.providers import lxc
from rally import exceptions
from rally.i18n import _
from rally import objects
from rally.openstack.common.gettextutils import _ # noqa
from rally.openstack.common import log as logging
from rally import utils

View File

@ -22,7 +22,7 @@ import netaddr
from rally.deploy.serverprovider import provider
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
from rally import utils

View File

@ -22,8 +22,8 @@ import novaclient.exceptions
from rally.benchmark import utils as benchmark_utils
from rally.deploy.serverprovider import provider
from rally import exceptions
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common.gettextutils import _
from rally.openstack.common import log as logging
from rally import osclients

View File

@ -18,7 +18,7 @@ import sys
from oslo.config import cfg
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
LOG = logging.getLogger(__name__)

35
rally/i18n.py Normal file
View File

@ -0,0 +1,35 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""oslo.i18n integration module for rally.
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
"""
from oslo import i18n
_translators = i18n.TranslatorFactory(domain='rally')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# Translators for log levels.
#
# The abbreviated names are meant to reflect the usual use of a short
# name like '_'. The "L" is for "log" and the other letter comes from
# the level.
_LI = _translators.log_info
_LW = _translators.log_warning
_LE = _translators.log_error
_LC = _translators.log_critical

View File

@ -64,7 +64,7 @@ import time
import paramiko
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging

View File

@ -28,7 +28,7 @@ import six
from sphinx.util import docstrings
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally.openstack.common import log as logging
LOG = logging.getLogger(__name__)

View File

@ -26,8 +26,8 @@ from six.moves import configparser
from rally import db
from rally import exceptions
from rally.i18n import _
from rally.objects import endpoint
from rally.openstack.common.gettextutils import _
from rally import osclients

View File

@ -23,7 +23,7 @@ import sys
from oslo.serialization import jsonutils
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally import utils
from rally.verification.verifiers.tempest import config
from rally.verification.verifiers.tempest import subunit2json

View File

@ -9,6 +9,7 @@ jsonschema>=2.0.0,<3.0.0
netaddr>=0.7.12
oslo.config>=1.4.0 # Apache-2.0
oslo.db>=1.0.0 # Apache-2.0
oslo.i18n>=1.0.0 # Apache-2.0
oslo.serialization>=1.0.0 # Apache-2.0
oslo.utils>=1.0.0 # Apache-2.0
paramiko>=1.13.0

View File

@ -22,7 +22,7 @@ import time
import mock
from rally import exceptions
from rally.openstack.common.gettextutils import _
from rally.i18n import _
from rally import utils
from tests.unit import test

View File

@ -44,5 +44,5 @@ builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,*rally/verification/verifiers/tempest/openstack-tempest*,build,*rally/openstack*
[hacking]
import_exceptions = rally.openstack.common.gettextutils._
import_exceptions = rally.i18n
local-check-factory = tests.hacking.checks.factory