Merge "Switch to internal _i18n pattern, as per oslo_i18n guidelines"

stable/ocata
Jenkins 8 years ago committed by Gerrit Code Review
commit 2e0c36ddbf

@ -0,0 +1,42 @@
# All Rights Reserved.
#
# 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.
import oslo_i18n
DOMAIN = "networking-l2gw"
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
# The primary translation function using the well-known name "_"
_ = _translators.primary
# The contextual translation function using the name "_C"
_C = _translators.contextual_form
# The plural translation function using the name "_P"
_P = _translators.plural_form
# 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
def get_available_languages():
return oslo_i18n.get_available_languages(DOMAIN)

@ -15,14 +15,13 @@
from neutron.agent import rpc as agent_rpc
from neutron import context
from neutron.i18n import _LE
from neutron.i18n import _LI
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_service import periodic_task
from networking_l2gw._i18n import _LE, _LI
from networking_l2gw.services.l2gateway.agent import agent_api
from networking_l2gw.services.l2gateway.common import constants as n_const
from networking_l2gw.services.l2gateway.common import topics

@ -24,9 +24,7 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
from neutron.i18n import _LE
from neutron.i18n import _LW
from networking_l2gw._i18n import _LE, _LW
from networking_l2gw.services.l2gateway.common import constants as n_const
LOG = logging.getLogger(__name__)

@ -17,12 +17,12 @@ import eventlet
from contextlib import contextmanager
from neutron import context as ctx
from neutron.i18n import _LE
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import loopingcall
from networking_l2gw._i18n import _LE
from networking_l2gw.services.l2gateway.agent import base_agent_manager
from networking_l2gw.services.l2gateway.agent import l2gateway_config
from networking_l2gw.services.l2gateway.agent.ovsdb import ovsdb_common_class

@ -16,13 +16,11 @@
import random
import eventlet
from neutron.i18n import _LE
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
from networking_l2gw._i18n import _LE
from networking_l2gw.services.l2gateway.agent.ovsdb import base_connection
from networking_l2gw.services.l2gateway.common import constants as n_const
from networking_l2gw.services.l2gateway.common import ovsdb_schema

@ -20,9 +20,7 @@ from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
from neutron.i18n import _LE
from neutron.i18n import _LW
from networking_l2gw._i18n import _LE, _LW
from networking_l2gw.services.l2gateway.agent.ovsdb import base_connection
from networking_l2gw.services.l2gateway.common import constants as n_const
from networking_l2gw.services.l2gateway.common import ovsdb_schema

@ -21,9 +21,9 @@ from oslo_service import loopingcall
from neutron import context as neutron_context
from neutron.db import agents_db
from neutron.i18n import _LE
from neutron import manager
from networking_l2gw._i18n import _LE
from networking_l2gw.services.l2gateway.common import config
from networking_l2gw.services.l2gateway.common import constants as srv_const

@ -14,10 +14,10 @@
# limitations under the License.
from neutron.common import constants
from neutron.i18n import _LE
from neutron import manager
from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc
from networking_l2gw._i18n import _LE
from networking_l2gw.db.l2gateway import l2gateway_db
from networking_l2gw.db.l2gateway.ovsdb import lib as db
from networking_l2gw.services.l2gateway.common import constants as n_const

@ -15,11 +15,11 @@
from neutron.common import exceptions as n_exc
from neutron.db import servicetype_db as st_db
from neutron.i18n import _LE
from neutron import manager
from neutron.services import provider_configuration as pconf
from neutron.services import service_base
from networking_l2gw._i18n import _LE
from networking_l2gw.db.l2gateway import l2gateway_db
from networking_l2gw.services.l2gateway.common import config
from networking_l2gw.services.l2gateway.common import constants

@ -19,8 +19,8 @@ from neutron.common import exceptions
from neutron.common import rpc as n_rpc
from neutron.db import agents_db
from neutron.extensions import portbindings
from neutron.i18n import _LE
from networking_l2gw._i18n import _LE
from networking_l2gw.db.l2gateway.ovsdb import lib as db
from networking_l2gw.services.l2gateway import agent_scheduler
from networking_l2gw.services.l2gateway.common import constants

@ -14,11 +14,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from networking_l2gw._i18n import _LI
from networking_l2gw.tests.api import base_l2gw
from networking_l2gw.tests.scenario import ovsdb_connections
from networking_l2gw.tests.tempest import config
from neutron.i18n import _LI
from neutron.tests.api import base
from neutron.tests.tempest import exceptions
from neutron.tests.tempest import manager

@ -20,9 +20,9 @@ import ssl
import mock
from neutron.i18n import _LW
from neutron.tests import base
from networking_l2gw._i18n import _LW
from networking_l2gw.services.l2gateway.agent import l2gateway_config as conf
from networking_l2gw.services.l2gateway.agent.ovsdb import base_connection
from networking_l2gw.services.l2gateway.agent.ovsdb import ovsdb_writer

@ -40,3 +40,6 @@ setenv = OS_TEST_PATH=./networking_l2gw/tests/api
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
OS_TEST_API_WITH_REST=1
OS_TEST_TIMEOUT=90
[hacking]
import_exceptions = networking_l2gw._i18n

Loading…
Cancel
Save