Fix I18N deprecation warnings
The gbpservice._i18n._ translation marker function is imported where needed, and use of the _ function for log messages is removed. This reduces the number of unique DeprecationWarning messages output during the master branch py27 tox job from 272 to 17. The remaining warnings are due to the use of deprecated keystone authentication APIs, the use of the deprecated tenant_id and username keys in API access policy files, and the use of tenant instead of project_id within this project, and due to various issues in other projects, including aci-integration-module, networking_sfc, and python-opflex-agent. Change-Id: I1cde26674ba368e239be299b2d130db98f2c0015
This commit is contained in:
parent
d149f30a4b
commit
87b14aee36
|
@ -19,6 +19,7 @@ from oslo_utils import uuidutils
|
|||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.common import utils as gbp_utils
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
|
||||
from gbpservice.neutron.extensions import group_policy as gpolicy
|
||||
|
|
|
@ -24,6 +24,8 @@ from neutron_lib.api import validators
|
|||
from neutron_lib.db import model_base
|
||||
from neutron_lib import exceptions as n_exc
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
def _subnetpool_model_hook(context, original_model, query):
|
||||
query = query.outerjoin(ImplicitSubnetpool,
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from neutron_lib.api import converters
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from neutron_lib.api import converters
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from neutron_lib.api import converters as conv
|
||||
from neutron_lib.api import extensions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import cisco_apic
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ from neutron_lib import constants as nlib_const
|
|||
from neutron_lib import exceptions as nexc
|
||||
from oslo_config import cfg
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
from gbpservice.neutron.services.grouppolicy.common import exceptions as gp_exc
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ from oslo_log import log as logging
|
|||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron import extensions as gbp_extensions
|
||||
from gbpservice.neutron.extensions import patch # noqa
|
||||
from gbpservice.neutron.services.grouppolicy.common import (
|
||||
|
|
|
@ -25,6 +25,7 @@ from oslo_config import cfg
|
|||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron import extensions as gbp_extensions
|
||||
import gbpservice.neutron.extensions.group_policy # noqa
|
||||
from gbpservice.neutron.services.servicechain.common import constants as scc
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
from oslo_log import log
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.plugins.ml2plus.drivers.apic_aim import exceptions
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
apic_opts = [
|
||||
cfg.BoolOpt('enable_optimized_dhcp', default=True),
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
from neutron_lib import exceptions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
class InternalError(exceptions.NeutronException):
|
||||
message = _("Internal mechanism driver error - %(details)s.")
|
||||
|
|
|
@ -32,6 +32,7 @@ from oslo_log import log as logging
|
|||
from oslo_utils import excutils
|
||||
from sqlalchemy import inspect
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron import extensions as extensions_pkg
|
||||
from gbpservice.neutron.extensions import cisco_apic_l3 as l3_ext
|
||||
from gbpservice.neutron.plugins.ml2plus.drivers.apic_aim import (
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
from neutron_lib import exceptions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
class GroupPolicyDriverError(exceptions.NeutronException):
|
||||
"""Policy driver call failed."""
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
group_policy_opts = [
|
||||
cfg.ListOpt('policy_drivers',
|
||||
|
|
|
@ -20,6 +20,7 @@ from oslo_serialization import jsonutils
|
|||
from oslo_utils import excutils
|
||||
import sqlalchemy as sa
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.common import utils
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db as gpdb
|
||||
|
|
|
@ -33,6 +33,7 @@ from oslo_log import helpers as log
|
|||
from oslo_log import log as logging
|
||||
from oslo_utils import excutils
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.common import utils as gbp_utils
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
|
||||
|
|
|
@ -15,6 +15,7 @@ import six
|
|||
|
||||
from neutron_lib import constants as n_constants
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db as gpdb
|
||||
from gbpservice.neutron.services.grouppolicy.common import constants as g_const
|
||||
from gbpservice.neutron.services.grouppolicy.common import exceptions as gpexc
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
# REVISIT: Auto-PTG is currently config driven to align with the
|
||||
# config driven behavior of the older driver but is slated for
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from oslo_log import log as logging
|
||||
import re
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.db.grouppolicy.extensions import (
|
||||
apic_allowed_vm_name_db as db)
|
||||
from gbpservice.neutron.extensions import apic_allowed_vm_name as aavnext
|
||||
|
|
|
@ -17,6 +17,7 @@ from oslo_log import log as logging
|
|||
from oslo_utils import excutils
|
||||
import sqlalchemy as sa
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
from gbpservice.neutron.extensions import driver_proxy_group as pg_ext
|
||||
from gbpservice.neutron.extensions import group_policy as gbp_ext
|
||||
|
|
|
@ -34,6 +34,7 @@ from oslo_utils import excutils
|
|||
import sqlalchemy as sa
|
||||
from sqlalchemy.orm import exc as sa_exc
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.common import utils
|
||||
from gbpservice.network.neutronv2 import local_api
|
||||
from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
|
||||
|
|
|
@ -25,6 +25,7 @@ from vmware_nsxlib.v3 import config
|
|||
from vmware_nsxlib.v3 import exceptions as nsxlib_exc
|
||||
from vmware_nsxlib.v3 import resources as nsx_resources
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.services.grouppolicy.common import constants as g_const
|
||||
from gbpservice.neutron.services.grouppolicy.common import exceptions as gpexc
|
||||
from gbpservice.neutron.services.grouppolicy.drivers import (
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
from neutron_lib import exceptions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
class ServiceChainDriverError(exceptions.NeutronException):
|
||||
"""ServiceChain driver call failed."""
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
from oslo_config import cfg
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
service_chain_opts = [
|
||||
cfg.ListOpt('node_drivers',
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
from neutron_lib import exceptions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
class NodeDriverError(exceptions.NeutronException):
|
||||
"""Node driver call failed."""
|
||||
|
|
|
@ -24,6 +24,7 @@ from oslo_log import log as logging
|
|||
from oslo_serialization import jsonutils
|
||||
import sqlalchemy as sa
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.services.servicechain.plugins.ncp import (
|
||||
exceptions as exc)
|
||||
from gbpservice.neutron.services.servicechain.plugins.ncp import driver_base
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
from neutron_lib import exceptions
|
||||
|
||||
from gbpservice._i18n import _
|
||||
|
||||
|
||||
class UnsupportedConfiguration(exceptions.BadRequest):
|
||||
message = _("Configuration %(conf)s for object of type %(type)s is not "
|
||||
|
|
|
@ -40,8 +40,8 @@ class LoggerPlusMechanismDriver(driver_api.MechanismDriver,
|
|||
LOG.info("ensure_tenant called with tenant_id %s", tenant_id)
|
||||
|
||||
def _log_subnetpool_call(self, method_name, context):
|
||||
LOG.info(_("%(method)s called with subnetpool settings %(current)s "
|
||||
"(original settings %(original)s)"),
|
||||
LOG.info("%(method)s called with subnetpool settings %(current)s "
|
||||
"(original settings %(original)s)",
|
||||
{'method': method_name,
|
||||
'current': context.current,
|
||||
'original': context.original})
|
||||
|
@ -71,8 +71,8 @@ class LoggerPlusMechanismDriver(driver_api.MechanismDriver,
|
|||
context)
|
||||
|
||||
def _log_address_scope_call(self, method_name, context):
|
||||
LOG.info(_("%(method)s called with address_scope settings %(current)s "
|
||||
"(original settings %(original)s)"),
|
||||
LOG.info("%(method)s called with address_scope settings %(current)s "
|
||||
"(original settings %(original)s)",
|
||||
{'method': method_name,
|
||||
'current': context.current,
|
||||
'original': context.original})
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
from neutron_lib.api import extensions
|
||||
from neutron_lib import constants
|
||||
|
||||
from gbpservice._i18n import _
|
||||
from gbpservice.neutron.extensions import group_policy as gp
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue