From 313b6a4d5ce98251ad56e44e2eaaf5490dc27a51 Mon Sep 17 00:00:00 2001 From: "yan.haifeng" Date: Mon, 9 Nov 2015 10:27:54 +0800 Subject: [PATCH] Fix misuse of log marker functions in neutron some log marker functions misuse in neutron, ref http://docs.openstack.org/developer/oslo.i18n/guidelines.html and http://docs.openstack.org/developer/oslo.i18n/usage.html Change-Id: Ia7a539f9414c4aa9666fa62522083ef48950e093 Closes-Bug: #1514193 --- neutron/agent/linux/iptables_manager.py | 2 +- neutron/agent/ovsdb/impl_idl.py | 3 +-- neutron/db/l3_db.py | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py index 4735ac771a1..d6c9e0108d7 100644 --- a/neutron/agent/linux/iptables_manager.py +++ b/neutron/agent/linux/iptables_manager.py @@ -403,7 +403,7 @@ class IptablesManager(object): try: self.defer_apply_off() except Exception: - msg = _LE('Failure applying iptables rules') + msg = _('Failure applying iptables rules') LOG.exception(msg) raise n_exc.IpTablesApplyException(msg) diff --git a/neutron/agent/ovsdb/impl_idl.py b/neutron/agent/ovsdb/impl_idl.py index 86c757d262f..c4bd2cb7e94 100644 --- a/neutron/agent/ovsdb/impl_idl.py +++ b/neutron/agent/ovsdb/impl_idl.py @@ -24,7 +24,6 @@ from neutron.agent.ovsdb import api from neutron.agent.ovsdb.native import commands as cmd from neutron.agent.ovsdb.native import connection from neutron.agent.ovsdb.native import idlutils -from neutron.i18n import _LE OPTS = [ @@ -98,7 +97,7 @@ class Transaction(api.Transaction): seqno) continue elif status == txn.ERROR: - msg = _LE("OVSDB Error: %s") % txn.get_error() + msg = _("OVSDB Error: %s") % txn.get_error() if self.log_errors: LOG.error(msg) if self.check_error: diff --git a/neutron/db/l3_db.py b/neutron/db/l3_db.py index 0f01040f5da..a9d120fce2d 100644 --- a/neutron/db/l3_db.py +++ b/neutron/db/l3_db.py @@ -37,7 +37,7 @@ from neutron.db import model_base from neutron.db import models_v2 from neutron.extensions import external_net from neutron.extensions import l3 -from neutron.i18n import _LI, _LE +from neutron.i18n import _LI from neutron import manager from neutron.plugins.common import constants from neutron.plugins.common import utils as p_utils @@ -524,7 +524,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase): device_id=port['device_id']) if not port['fixed_ips']: - msg = _LE('Router port must have at least one fixed IP') + msg = _('Router port must have at least one fixed IP') raise n_exc.BadRequest(resource='router', msg=msg) # Only allow one router port with IPv6 subnets per network id @@ -553,8 +553,8 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase): # Keep the restriction against multiple IPv4 subnets if len([s for s in subnets if s['ip_version'] == 4]) > 1: - msg = _LE("Cannot have multiple " - "IPv4 subnets on router port") + msg = _("Cannot have multiple " + "IPv4 subnets on router port") raise n_exc.BadRequest(resource='router', msg=msg) port.update({'device_id': router.id, 'device_owner': owner})