]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix misuse of log marker functions in neutron
authoryan.haifeng <yanheven@qq.com>
Mon, 9 Nov 2015 02:27:54 +0000 (10:27 +0800)
committeryan.haifeng <yanheven@qq.com>
Mon, 9 Nov 2015 02:27:54 +0000 (10:27 +0800)
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
neutron/agent/ovsdb/impl_idl.py
neutron/db/l3_db.py

index 4735ac771a1dc9656d6bdc67b9d3379c86c135f3..d6c9e0108d75e9cd4836fa0002c9598ed9f08a9e 100644 (file)
@@ -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)
 
index 86c757d262f416f8e9b90fe51babb84b8350ef00..c4bd2cb7e94228f3d8b5e5b76c07fb7c6e797d19 100644 (file)
@@ -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:
index 0f01040f5da257e19679d0fbacd7af166863f09a..a9d120fce2da42f4a54b880bfcac6376ebc4e16b 100644 (file)
@@ -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})