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
This commit is contained in:
yan.haifeng 2015-11-09 10:27:54 +08:00
parent f225e0a686
commit 313b6a4d5c
3 changed files with 6 additions and 7 deletions

View 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)

View 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:

View 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})