Cleanup i18n module usages
* Add neutron_fwaas._i18n * Use neutron_fwaas._i18n instead of neutron.i18n * Consume _ from neutron_fwaas._i18n instead of the builtins namespace * 'builtins = _' in tox.ini is no longer needed. These changes are suggested in oslo.i18n document http://docs.openstack.org/developer/oslo.i18n/usage.html Change-Id: Ieb31cf31f724a265bd1330cbe77a792945105345
This commit is contained in:
parent
44afb930f6
commit
fdb235b499
|
@ -16,6 +16,8 @@ from neutron.api import extensions
|
|||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.common import exceptions as excp
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
|
||||
|
||||
class InvalidInterfaceForCSRFW(excp.NotFound):
|
||||
message = _("Interface id %(port_id)s provided "
|
||||
|
|
|
@ -26,6 +26,8 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ from neutron.api import extensions
|
|||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.common import exceptions as nexception
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
|
||||
|
||||
class FirewallRouterInUse(nexception.InUse):
|
||||
message = _("Router(s) %(router_ids)s provided already associated with "
|
||||
|
|
|
@ -17,6 +17,8 @@ from neutron.common import rpc as n_rpc
|
|||
from oslo_config import cfg
|
||||
import oslo_messaging
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
|
||||
|
||||
FWaaSOpts = [
|
||||
cfg.StrOpt(
|
||||
|
|
|
@ -18,6 +18,8 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
FIREWALL_DRIVERS = 'firewall_drivers'
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
|
||||
from neutron.agent.linux import ip_lib
|
||||
from neutron import context
|
||||
from neutron.i18n import _LE
|
||||
from neutron.plugins.common import constants as n_const
|
||||
from oslo_config import cfg
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron_fwaas._i18n import _, _LE
|
||||
from neutron_fwaas.common import fwaas_constants as f_const
|
||||
from neutron_fwaas.extensions import firewall as fw_ext
|
||||
from neutron_fwaas.services.firewall.agents import firewall_agent_api as api
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
import base64
|
||||
|
||||
import httplib2
|
||||
from neutron.i18n import _LE
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from neutron_fwaas._i18n import _, _LE
|
||||
from neutron_fwaas.services.firewall.agents.varmour \
|
||||
import varmour_utils as va_utils
|
||||
|
||||
|
|
|
@ -29,12 +29,12 @@ from neutron.agent.linux import interface
|
|||
from neutron.agent.linux import ip_lib
|
||||
from neutron.common import config as common_config
|
||||
from neutron.common import constants as l3_constants
|
||||
from neutron.i18n import _LW
|
||||
from neutron import service as neutron_service
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_service import service
|
||||
|
||||
from neutron_fwaas._i18n import _, _LW
|
||||
from neutron_fwaas.common import fwaas_constants as f_const
|
||||
from neutron_fwaas.services.firewall.agents.l3reference \
|
||||
import firewall_l3_agent
|
||||
|
|
|
@ -17,9 +17,9 @@ import requests
|
|||
|
||||
from networking_cisco.plugins.cisco.cfg_agent.device_drivers import (
|
||||
cisco_csr_rest_client)
|
||||
from neutron.i18n import _LE
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron_fwaas._i18n import _LE
|
||||
from neutron_fwaas.services.firewall.drivers import fwaas_base
|
||||
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ from networking_cisco.plugins.cisco.cfg_agent.service_helpers import (
|
|||
service_helper)
|
||||
from neutron.common import rpc as n_rpc
|
||||
from neutron import context as n_context
|
||||
from neutron.i18n import _LE
|
||||
from neutron.plugins.common import constants
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
|
||||
from neutron_fwaas._i18n import _LE
|
||||
from neutron_fwaas.services.firewall.drivers.cisco import csr_acl_driver
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# under the License.
|
||||
|
||||
from neutron.agent.linux import iptables_manager
|
||||
from neutron.i18n import _LE
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron_fwaas._i18n import _LE
|
||||
from neutron_fwaas.extensions import firewall as fw_ext
|
||||
from neutron_fwaas.services.firewall.drivers import fwaas_base
|
||||
|
||||
|
|
|
@ -22,13 +22,15 @@
|
|||
import netaddr
|
||||
|
||||
from neutron.common import constants
|
||||
from neutron_fwaas.services.firewall.drivers import fwaas_base
|
||||
import neutron_fwaas.services.firewall.drivers.mcafee.smc_api as smc_api
|
||||
from oslo_config import cfg
|
||||
from oslo_log import helpers as log_helpers
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from neutron_fwaas._i18n import _
|
||||
from neutron_fwaas.services.firewall.drivers import fwaas_base
|
||||
from neutron_fwaas.services.firewall.drivers.mcafee import smc_api
|
||||
|
||||
|
||||
NGFWOpts = [
|
||||
cfg.StrOpt(
|
||||
|
|
|
@ -27,10 +27,10 @@ import six
|
|||
|
||||
from contextlib import contextmanager
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.i18n import _LE, _LI, _LW
|
||||
from oslo_log import log as logging
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from neutron_fwaas._i18n import _, _LE, _LI, _LW
|
||||
from neutron_fwaas.services.firewall.drivers.mcafee import constants as const
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.i18n import _LW
|
||||
from oslo_log import log as logging
|
||||
|
||||
from neutron_fwaas._i18n import _LW
|
||||
from neutron_fwaas.services.firewall.agents.varmour import varmour_api
|
||||
from neutron_fwaas.services.firewall.agents.varmour \
|
||||
import varmour_utils as va_utils
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
from networking_brocade.vyatta.common import config as vyatta_config
|
||||
from networking_brocade.vyatta.vrouter import client as vyatta_client
|
||||
from neutron import context as neutron_context
|
||||
from neutron.i18n import _LW
|
||||
from novaclient import client as nova_client
|
||||
from oslo_log import log as logging
|
||||
from six.moves.urllib import parse
|
||||
|
||||
from neutron_fwaas._i18n import _LW
|
||||
from neutron_fwaas.services.firewall.agents.vyatta import vyatta_utils
|
||||
from neutron_fwaas.services.firewall.drivers import fwaas_base
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
from neutron.api.v2 import attributes as attr
|
||||
from neutron.common import rpc as n_rpc
|
||||
from neutron import context as neutron_context
|
||||
from neutron.i18n import _LW
|
||||
from neutron import manager
|
||||
from neutron.plugins.common import constants as n_const
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
|
||||
from neutron_fwaas._i18n import _LW
|
||||
from neutron_fwaas.common import fwaas_constants as f_const
|
||||
from neutron_fwaas.db.firewall import firewall_db
|
||||
from neutron_fwaas.db.firewall import firewall_router_insertion_db
|
||||
|
|
|
@ -17,7 +17,6 @@ from neutron.api.v2 import attributes as attr
|
|||
from neutron.common import constants as l3_const
|
||||
from neutron.common import rpc as n_rpc
|
||||
from neutron import context as neutron_context
|
||||
from neutron.i18n import _LW
|
||||
from neutron import manager
|
||||
from neutron.plugins.common import constants as const
|
||||
from oslo_config import cfg
|
||||
|
@ -25,6 +24,7 @@ from oslo_log import helpers as log_helpers
|
|||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
|
||||
from neutron_fwaas._i18n import _LW
|
||||
from neutron_fwaas.db.cisco import cisco_fwaas_db as csrfw_db
|
||||
import neutron_fwaas.extensions
|
||||
from neutron_fwaas.extensions.cisco import csr_firewall_insertion as csr_ext
|
||||
|
|
3
tox.ini
3
tox.ini
|
@ -88,7 +88,6 @@ commands = {[testenv:docs]commands}
|
|||
# TODO(marun) H404 multi line docstring should start with a summary
|
||||
ignore = E125,E126,E128,E129,E265,H404,H405
|
||||
show-source = true
|
||||
builtins = _
|
||||
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios
|
||||
|
||||
[testenv:pylint]
|
||||
|
@ -105,7 +104,7 @@ commands =
|
|||
pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_fwaas}
|
||||
|
||||
[hacking]
|
||||
import_exceptions = neutron.i18n
|
||||
import_exceptions = neutron_fwaas._i18n
|
||||
local-check-factory = neutron.hacking.checks.factory
|
||||
|
||||
[testenv:genconfig]
|
||||
|
|
Loading…
Reference in New Issue