summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInessa Vasilevskaya <ivasilevskaya@mirantis.com>2017-04-04 19:14:12 +0300
committerAkihiro Motoki <amotoki@gmail.com>2017-08-14 02:01:48 +0000
commit7322bd6efb6e61acb2e967be22f84554d064ec7e (patch)
tree2fb47f306072168cd092773b64f156b48c8d68b1
parentc65e541b6ed9a7d2b1dc8825c705eaa10b7cc650 (diff)
Make code follow log translation guideline
Since Pike log messages should not be translated. This patch removes calls to i18n _LC, _LI, _LE, _LW from logging logic throughout the code. Translators definition from neutron._i18n is removed as well. This patch also removes log translation verification from ignore directive in tox.ini. Change-Id: If9aa76fcf121c0e61a7c08088006c5873faee56e
Notes
Notes (review): Code-Review+2: Akihiro Motoki <amotoki@gmail.com> Verified+1: Mellanox CI <mlnx-openstack-ci@dev.mellanox.co.il> Workflow+1: Akihiro Motoki <amotoki@gmail.com> Code-Review+2: Ihar Hrachyshka <ihrachys@redhat.com> Workflow+1: Ihar Hrachyshka <ihrachys@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 14 Aug 2017 17:42:09 +0000 Reviewed-on: https://review.openstack.org/453355 Project: openstack/neutron Branch: refs/heads/master
-rw-r--r--neutron/_i18n.py10
-rw-r--r--neutron/agent/agent_extensions_manager.py5
-rw-r--r--neutron/agent/common/ovs_lib.py26
-rw-r--r--neutron/agent/common/utils.py3
-rw-r--r--neutron/agent/dhcp/agent.py62
-rw-r--r--neutron/agent/l2/extensions/fdb_population.py29
-rw-r--r--neutron/agent/l2/extensions/qos.py11
-rw-r--r--neutron/agent/l2/l2_agent_extensions_manager.py9
-rw-r--r--neutron/agent/l3/agent.py82
-rw-r--r--neutron/agent/l3/dvr_edge_router.py5
-rw-r--r--neutron/agent/l3/dvr_fip_ns.py22
-rw-r--r--neutron/agent/l3/dvr_local_router.py17
-rw-r--r--neutron/agent/l3/dvr_router_base.py11
-rw-r--r--neutron/agent/l3/ha.py7
-rw-r--r--neutron/agent/l3/ha_router.py7
-rw-r--r--neutron/agent/l3/item_allocator.py5
-rw-r--r--neutron/agent/l3/keepalived_state_change.py6
-rw-r--r--neutron/agent/l3/l3_agent_extensions_manager.py13
-rw-r--r--neutron/agent/l3/namespace_manager.py7
-rw-r--r--neutron/agent/l3/namespaces.py7
-rw-r--r--neutron/agent/l3/router_info.py14
-rw-r--r--neutron/agent/linux/async_process.py12
-rw-r--r--neutron/agent/linux/daemon.py12
-rw-r--r--neutron/agent/linux/dhcp.py41
-rw-r--r--neutron/agent/linux/external_process.py18
-rw-r--r--neutron/agent/linux/interface.py22
-rw-r--r--neutron/agent/linux/ip_conntrack.py4
-rw-r--r--neutron/agent/linux/ip_lib.py26
-rw-r--r--neutron/agent/linux/ip_link_support.py4
-rw-r--r--neutron/agent/linux/ip_monitor.py5
-rw-r--r--neutron/agent/linux/iptables_firewall.py9
-rw-r--r--neutron/agent/linux/iptables_manager.py20
-rw-r--r--neutron/agent/linux/keepalived.py6
-rw-r--r--neutron/agent/linux/openvswitch_firewall/firewall.py5
-rw-r--r--neutron/agent/linux/ovsdb_monitor.py3
-rw-r--r--neutron/agent/linux/pd.py6
-rw-r--r--neutron/agent/linux/utils.py6
-rw-r--r--neutron/agent/linux/xenapi_root_helper.py3
-rw-r--r--neutron/agent/metadata/agent.py14
-rw-r--r--neutron/agent/ovsdb/impl_vsctl.py9
-rw-r--r--neutron/agent/securitygroups_rpc.py35
-rw-r--r--neutron/agent/windows/ip_lib.py8
-rw-r--r--neutron/api/api_common.py6
-rw-r--r--neutron/api/extensions.py35
-rw-r--r--neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py21
-rw-r--r--neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py5
-rw-r--r--neutron/api/rpc/agentnotifiers/utils.py6
-rw-r--r--neutron/api/rpc/handlers/dhcp_rpc.py8
-rw-r--r--neutron/api/rpc/handlers/securitygroups_rpc.py7
-rw-r--r--neutron/api/v2/base.py10
-rw-r--r--neutron/api/v2/resource.py16
-rw-r--r--neutron/cmd/ipset_cleanup.py15
-rw-r--r--neutron/cmd/linuxbridge_cleanup.py15
-rw-r--r--neutron/cmd/netns_cleanup.py11
-rw-r--r--neutron/cmd/ovs_cleanup.py7
-rw-r--r--neutron/cmd/sanity/checks.py15
-rw-r--r--neutron/cmd/sanity_check.py158
-rw-r--r--neutron/common/config.py6
-rw-r--r--neutron/common/ipv6_utils.py10
-rw-r--r--neutron/common/profiler.py18
-rw-r--r--neutron/common/rpc.py19
-rw-r--r--neutron/common/utils.py12
-rw-r--r--neutron/db/_utils.py7
-rw-r--r--neutron/db/agents_db.py30
-rw-r--r--neutron/db/agentschedulers_db.py62
-rw-r--r--neutron/db/api.py5
-rw-r--r--neutron/db/db_base_plugin_v2.py12
-rw-r--r--neutron/db/dns_db.py22
-rw-r--r--neutron/db/dvr_mac_db.py8
-rw-r--r--neutron/db/ipam_backend_mixin.py30
-rw-r--r--neutron/db/ipam_pluggable_backend.py11
-rw-r--r--neutron/db/l3_agentschedulers_db.py10
-rw-r--r--neutron/db/l3_db.py16
-rw-r--r--neutron/db/l3_dvr_db.py20
-rw-r--r--neutron/db/l3_hamode_db.py28
-rw-r--r--neutron/db/metering/metering_rpc.py3
-rw-r--r--neutron/db/provisioning_blocks.py11
-rw-r--r--neutron/db/segments_db.py5
-rw-r--r--neutron/db/standard_attr.py16
-rw-r--r--neutron/debug/commands.py4
-rw-r--r--neutron/debug/debug_agent.py3
-rw-r--r--neutron/debug/shell.py7
-rw-r--r--neutron/extensions/l3agentscheduler.py10
-rw-r--r--neutron/extensions/vlantransparent.py4
-rw-r--r--neutron/ipam/drivers/neutrondb_ipam/driver.py12
-rw-r--r--neutron/manager.py10
-rw-r--r--neutron/notifiers/nova.py17
-rw-r--r--neutron/pecan_wsgi/controllers/resource.py5
-rw-r--r--neutron/pecan_wsgi/controllers/root.py5
-rw-r--r--neutron/pecan_wsgi/hooks/translation.py5
-rw-r--r--neutron/plugins/common/utils.py12
-rw-r--r--neutron/plugins/ml2/db.py8
-rw-r--r--neutron/plugins/ml2/driver_context.py3
-rw-r--r--neutron/plugins/ml2/drivers/agent/_common_agent.py41
-rw-r--r--neutron/plugins/ml2/drivers/helpers.py3
-rw-r--r--neutron/plugins/ml2/drivers/l2pop/mech_driver.py6
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/agent/arp_protect.py7
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/agent/common/utils.py5
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/agent/extension_drivers/qos_driver.py3
-rw-r--r--neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py105
-rw-r--r--neutron/plugins/ml2/drivers/macvtap/agent/macvtap_neutron_agent.py33
-rw-r--r--neutron/plugins/ml2/drivers/macvtap/mech_driver/mech_macvtap.py19
-rw-r--r--neutron/plugins/ml2/drivers/mech_agent.py5
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/eswitch_manager.py20
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/extension_drivers/qos_driver.py9
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/pci_lib.py13
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py50
-rw-r--r--neutron/plugins/ml2/drivers/mech_sriov/mech_driver/mech_driver.py4
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py3
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ofswitch.py4
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_bridge.py15
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ovs_ryuapp.py3
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/ofswitch.py4
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py51
-rw-r--r--neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py178
-rw-r--r--neutron/plugins/ml2/drivers/type_flat.py14
-rw-r--r--neutron/plugins/ml2/drivers/type_geneve.py4
-rw-r--r--neutron/plugins/ml2/drivers/type_gre.py5
-rw-r--r--neutron/plugins/ml2/drivers/type_local.py4
-rw-r--r--neutron/plugins/ml2/drivers/type_tunnel.py14
-rw-r--r--neutron/plugins/ml2/drivers/type_vlan.py14
-rw-r--r--neutron/plugins/ml2/drivers/type_vxlan.py5
-rw-r--r--neutron/plugins/ml2/extensions/dns_integration.py23
-rw-r--r--neutron/plugins/ml2/extensions/port_security.py3
-rw-r--r--neutron/plugins/ml2/managers.py88
-rw-r--r--neutron/plugins/ml2/plugin.py96
-rw-r--r--neutron/plugins/ml2/rpc.py13
-rw-r--r--neutron/policy.py7
-rw-r--r--neutron/privileged/agent/linux/netlink_lib.py4
-rw-r--r--neutron/quota/__init__.py16
-rw-r--r--neutron/quota/resource.py15
-rw-r--r--neutron/quota/resource_registry.py12
-rw-r--r--neutron/scheduler/dhcp_agent_scheduler.py8
-rw-r--r--neutron/scheduler/l3_agent_scheduler.py11
-rw-r--r--neutron/server/rpc_eventlet.py7
-rw-r--r--neutron/server/wsgi_eventlet.py5
-rw-r--r--neutron/service.py23
-rw-r--r--neutron/services/auto_allocate/db.py30
-rw-r--r--neutron/services/l3_router/l3_router_plugin.py3
-rw-r--r--neutron/services/metering/agents/metering_agent.py20
-rw-r--r--neutron/services/metering/drivers/iptables/iptables_driver.py9
-rw-r--r--neutron/services/metering/drivers/utils.py4
-rw-r--r--neutron/services/provider_configuration.py12
-rw-r--r--neutron/services/qos/drivers/manager.py8
-rw-r--r--neutron/services/revisions/revision_plugin.py6
-rw-r--r--neutron/services/segments/plugin.py14
-rw-r--r--neutron/services/service_base.py9
-rw-r--r--neutron/services/timestamp/timestamp_db.py5
-rw-r--r--neutron/services/trunk/drivers/linuxbridge/agent/driver.py4
-rw-r--r--neutron/services/trunk/drivers/linuxbridge/agent/trunk_plumber.py3
-rw-r--r--neutron/services/trunk/drivers/openvswitch/agent/driver.py11
-rw-r--r--neutron/services/trunk/drivers/openvswitch/agent/ovsdb_handler.py48
-rw-r--r--neutron/services/trunk/drivers/openvswitch/agent/trunk_manager.py6
-rw-r--r--neutron/services/trunk/rpc/server.py7
-rw-r--r--neutron/tests/unit/plugins/ml2/drivers/mechanism_logger.py39
-rw-r--r--neutron/wsgi.py20
-rw-r--r--tox.ini4
157 files changed, 1270 insertions, 1391 deletions
diff --git a/neutron/_i18n.py b/neutron/_i18n.py
index 5b9b5fa..65c95c0 100644
--- a/neutron/_i18n.py
+++ b/neutron/_i18n.py
@@ -27,16 +27,6 @@ _C = _translators.contextual_form
27# The plural translation function using the name "_P" 27# The plural translation function using the name "_P"
28_P = _translators.plural_form 28_P = _translators.plural_form
29 29
30# Translators for log levels.
31#
32# The abbreviated names are meant to reflect the usual use of a short
33# name like '_'. The "L" is for "log" and the other letter comes from
34# the level.
35_LI = _translators.log_info
36_LW = _translators.log_warning
37_LE = _translators.log_error
38_LC = _translators.log_critical
39
40 30
41def get_available_languages(): 31def get_available_languages():
42 return oslo_i18n.get_available_languages(DOMAIN) 32 return oslo_i18n.get_available_languages(DOMAIN)
diff --git a/neutron/agent/agent_extensions_manager.py b/neutron/agent/agent_extensions_manager.py
index 70a6537..a4758da 100644
--- a/neutron/agent/agent_extensions_manager.py
+++ b/neutron/agent/agent_extensions_manager.py
@@ -13,7 +13,6 @@
13from oslo_log import log 13from oslo_log import log
14import stevedore 14import stevedore
15 15
16from neutron._i18n import _LI
17from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config 16from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config
18 17
19LOG = log.getLogger(__name__) 18LOG = log.getLogger(__name__)
@@ -28,7 +27,7 @@ class AgentExtensionsManager(stevedore.named.NamedExtensionManager):
28 super(AgentExtensionsManager, self).__init__( 27 super(AgentExtensionsManager, self).__init__(
29 namespace, conf.agent.extensions, 28 namespace, conf.agent.extensions,
30 invoke_on_load=True, name_order=True) 29 invoke_on_load=True, name_order=True)
31 LOG.info(_LI("Loaded agent extensions: %s"), self.names()) 30 LOG.info("Loaded agent extensions: %s", self.names())
32 31
33 def initialize(self, connection, driver_type, agent_api=None): 32 def initialize(self, connection, driver_type, agent_api=None):
34 """Initialize enabled agent extensions. 33 """Initialize enabled agent extensions.
@@ -44,7 +43,7 @@ class AgentExtensionsManager(stevedore.named.NamedExtensionManager):
44 """ 43 """
45 # Initialize each agent extension in the list. 44 # Initialize each agent extension in the list.
46 for extension in self: 45 for extension in self:
47 LOG.info(_LI("Initializing agent extension '%s'"), extension.name) 46 LOG.info("Initializing agent extension '%s'", extension.name)
48 # If the agent has provided an agent_api object, this object will 47 # If the agent has provided an agent_api object, this object will
49 # be passed to all interested extensions. This object must be 48 # be passed to all interested extensions. This object must be
50 # consumed by each such extension before the extension's 49 # consumed by each such extension before the extension's
diff --git a/neutron/agent/common/ovs_lib.py b/neutron/agent/common/ovs_lib.py
index cce168f..88412e3 100644
--- a/neutron/agent/common/ovs_lib.py
+++ b/neutron/agent/common/ovs_lib.py
@@ -27,7 +27,7 @@ from oslo_log import log as logging
27import six 27import six
28import tenacity 28import tenacity
29 29
30from neutron._i18n import _, _LE, _LI, _LW 30from neutron._i18n import _
31from neutron.agent.common import ip_lib 31from neutron.agent.common import ip_lib
32from neutron.agent.common import utils 32from neutron.agent.common import utils
33from neutron.agent.ovsdb import api as ovsdb_api 33from neutron.agent.ovsdb import api as ovsdb_api
@@ -298,8 +298,8 @@ class OVSBridge(BaseOVS):
298 "in 1 second. Attempt: %s/10", i) 298 "in 1 second. Attempt: %s/10", i)
299 time.sleep(1) 299 time.sleep(1)
300 continue 300 continue
301 LOG.error(_LE("Unable to execute %(cmd)s. Exception: " 301 LOG.error("Unable to execute %(cmd)s. Exception: "
302 "%(exception)s"), 302 "%(exception)s",
303 {'cmd': full_args, 'exception': e}) 303 {'cmd': full_args, 'exception': e})
304 break 304 break
305 305
@@ -320,7 +320,7 @@ class OVSBridge(BaseOVS):
320 try: 320 try:
321 ofport = self._get_port_val(port_name, "ofport") 321 ofport = self._get_port_val(port_name, "ofport")
322 except tenacity.RetryError: 322 except tenacity.RetryError:
323 LOG.exception(_LE("Timed out retrieving ofport on port %s."), 323 LOG.exception("Timed out retrieving ofport on port %s.",
324 port_name) 324 port_name)
325 return ofport 325 return ofport
326 326
@@ -330,7 +330,7 @@ class OVSBridge(BaseOVS):
330 try: 330 try:
331 port_external_ids = self._get_port_val(port_name, "external_ids") 331 port_external_ids = self._get_port_val(port_name, "external_ids")
332 except tenacity.RetryError: 332 except tenacity.RetryError:
333 LOG.exception(_LE("Timed out retrieving external_ids on port %s."), 333 LOG.exception("Timed out retrieving external_ids on port %s.",
334 port_name) 334 port_name)
335 return port_external_ids 335 return port_external_ids
336 336
@@ -526,10 +526,10 @@ class OVSBridge(BaseOVS):
526 if_exists=True) 526 if_exists=True)
527 for result in results: 527 for result in results:
528 if result['ofport'] == UNASSIGNED_OFPORT: 528 if result['ofport'] == UNASSIGNED_OFPORT:
529 LOG.warning(_LW("Found not yet ready openvswitch port: %s"), 529 LOG.warning("Found not yet ready openvswitch port: %s",
530 result['name']) 530 result['name'])
531 elif result['ofport'] == INVALID_OFPORT: 531 elif result['ofport'] == INVALID_OFPORT:
532 LOG.warning(_LW("Found failed openvswitch port: %s"), 532 LOG.warning("Found failed openvswitch port: %s",
533 result['name']) 533 result['name'])
534 elif 'attached-mac' in result['external_ids']: 534 elif 'attached-mac' in result['external_ids']:
535 port_id = self.portid_from_external_ids(result['external_ids']) 535 port_id = self.portid_from_external_ids(result['external_ids'])
@@ -569,8 +569,8 @@ class OVSBridge(BaseOVS):
569 for port_id in port_ids: 569 for port_id in port_ids:
570 result[port_id] = None 570 result[port_id] = None
571 if port_id not in by_id: 571 if port_id not in by_id:
572 LOG.info(_LI("Port %(port_id)s not present in bridge " 572 LOG.info("Port %(port_id)s not present in bridge "
573 "%(br_name)s"), 573 "%(br_name)s",
574 {'port_id': port_id, 'br_name': self.br_name}) 574 {'port_id': port_id, 'br_name': self.br_name})
575 continue 575 continue
576 pinfo = by_id[port_id] 576 pinfo = by_id[port_id]
@@ -584,8 +584,8 @@ class OVSBridge(BaseOVS):
584 @staticmethod 584 @staticmethod
585 def _check_ofport(port_id, port_info): 585 def _check_ofport(port_id, port_info):
586 if port_info['ofport'] in [UNASSIGNED_OFPORT, INVALID_OFPORT]: 586 if port_info['ofport'] in [UNASSIGNED_OFPORT, INVALID_OFPORT]:
587 LOG.warning(_LW("ofport: %(ofport)s for VIF: %(vif)s " 587 LOG.warning("ofport: %(ofport)s for VIF: %(vif)s "
588 "is not a positive integer"), 588 "is not a positive integer",
589 {'ofport': port_info['ofport'], 'vif': port_id}) 589 {'ofport': port_info['ofport'], 'vif': port_id})
590 return False 590 return False
591 return True 591 return True
@@ -602,7 +602,7 @@ class OVSBridge(BaseOVS):
602 continue 602 continue
603 mac = port['external_ids'].get('attached-mac') 603 mac = port['external_ids'].get('attached-mac')
604 return VifPort(port['name'], port['ofport'], port_id, mac, self) 604 return VifPort(port['name'], port['ofport'], port_id, mac, self)
605 LOG.info(_LI("Port %(port_id)s not present in bridge %(br_name)s"), 605 LOG.info("Port %(port_id)s not present in bridge %(br_name)s",
606 {'port_id': port_id, 'br_name': self.br_name}) 606 {'port_id': port_id, 'br_name': self.br_name})
607 607
608 def delete_ports(self, all_ports=False): 608 def delete_ports(self, all_ports=False):
@@ -837,7 +837,7 @@ class DeferredOVSBridge(object):
837 if exc_type is None: 837 if exc_type is None:
838 self.apply_flows() 838 self.apply_flows()
839 else: 839 else:
840 LOG.exception(_LE("OVS flows could not be applied on bridge %s"), 840 LOG.exception("OVS flows could not be applied on bridge %s",
841 self.br.br_name) 841 self.br.br_name)
842 842
843 843
diff --git a/neutron/agent/common/utils.py b/neutron/agent/common/utils.py
index ebc1363..cafef1f 100644
--- a/neutron/agent/common/utils.py
+++ b/neutron/agent/common/utils.py
@@ -19,7 +19,6 @@ from oslo_config import cfg
19from oslo_log import log as logging 19from oslo_log import log as logging
20from oslo_utils import timeutils 20from oslo_utils import timeutils
21 21
22from neutron._i18n import _LE
23from neutron.common import utils as neutron_utils 22from neutron.common import utils as neutron_utils
24from neutron.conf.agent import common as config 23from neutron.conf.agent import common as config
25from neutron.conf.agent.database import agents_db 24from neutron.conf.agent.database import agents_db
@@ -53,7 +52,7 @@ def load_interface_driver(conf):
53 INTERFACE_NAMESPACE, conf.interface_driver) 52 INTERFACE_NAMESPACE, conf.interface_driver)
54 return loaded_class(conf) 53 return loaded_class(conf)
55 except ImportError: 54 except ImportError:
56 LOG.error(_LE("Error loading interface driver '%s'"), 55 LOG.error("Error loading interface driver '%s'",
57 conf.interface_driver) 56 conf.interface_driver)
58 raise SystemExit(1) 57 raise SystemExit(1)
59 58
diff --git a/neutron/agent/dhcp/agent.py b/neutron/agent/dhcp/agent.py
index 515e35e..6e33239 100644
--- a/neutron/agent/dhcp/agent.py
+++ b/neutron/agent/dhcp/agent.py
@@ -29,7 +29,7 @@ from oslo_utils import fileutils
29from oslo_utils import importutils 29from oslo_utils import importutils
30import six 30import six
31 31
32from neutron._i18n import _, _LE, _LI, _LW 32from neutron._i18n import _
33from neutron.agent.linux import dhcp 33from neutron.agent.linux import dhcp
34from neutron.agent.linux import external_process 34from neutron.agent.linux import external_process
35from neutron.agent.metadata import driver as metadata_driver 35from neutron.agent.metadata import driver as metadata_driver
@@ -120,7 +120,7 @@ class DhcpAgent(manager.Manager):
120 120
121 def after_start(self): 121 def after_start(self):
122 self.run() 122 self.run()
123 LOG.info(_LI("DHCP agent started")) 123 LOG.info("DHCP agent started")
124 124
125 def run(self): 125 def run(self):
126 """Activate the DHCP agent.""" 126 """Activate the DHCP agent."""
@@ -164,7 +164,7 @@ class DhcpAgent(manager.Manager):
164 or isinstance(e, exceptions.NetworkNotFound)): 164 or isinstance(e, exceptions.NetworkNotFound)):
165 LOG.debug("Network %s has been deleted.", network.id) 165 LOG.debug("Network %s has been deleted.", network.id)
166 else: 166 else:
167 LOG.exception(_LE('Unable to %(action)s dhcp for %(net_id)s.'), 167 LOG.exception('Unable to %(action)s dhcp for %(net_id)s.',
168 {'net_id': network.id, 'action': action}) 168 {'net_id': network.id, 'action': action})
169 169
170 def schedule_resync(self, reason, network_id=None): 170 def schedule_resync(self, reason, network_id=None):
@@ -179,21 +179,21 @@ class DhcpAgent(manager.Manager):
179 or 'None' is one of the networks, sync all of the networks. 179 or 'None' is one of the networks, sync all of the networks.
180 """ 180 """
181 only_nets = set([] if (not networks or None in networks) else networks) 181 only_nets = set([] if (not networks or None in networks) else networks)
182 LOG.info(_LI('Synchronizing state')) 182 LOG.info('Synchronizing state')
183 pool = eventlet.GreenPool(self.conf.num_sync_threads) 183 pool = eventlet.GreenPool(self.conf.num_sync_threads)
184 known_network_ids = set(self.cache.get_network_ids()) 184 known_network_ids = set(self.cache.get_network_ids())
185 185
186 try: 186 try:
187 active_networks = self.plugin_rpc.get_active_networks_info() 187 active_networks = self.plugin_rpc.get_active_networks_info()
188 LOG.info(_LI('All active networks have been fetched through RPC.')) 188 LOG.info('All active networks have been fetched through RPC.')
189 active_network_ids = set(network.id for network in active_networks) 189 active_network_ids = set(network.id for network in active_networks)
190 for deleted_id in known_network_ids - active_network_ids: 190 for deleted_id in known_network_ids - active_network_ids:
191 try: 191 try:
192 self.disable_dhcp_helper(deleted_id) 192 self.disable_dhcp_helper(deleted_id)
193 except Exception as e: 193 except Exception as e:
194 self.schedule_resync(e, deleted_id) 194 self.schedule_resync(e, deleted_id)
195 LOG.exception(_LE('Unable to sync network state on ' 195 LOG.exception('Unable to sync network state on '
196 'deleted network %s'), deleted_id) 196 'deleted network %s', deleted_id)
197 197
198 for network in active_networks: 198 for network in active_networks:
199 if (not only_nets or # specifically resync all 199 if (not only_nets or # specifically resync all
@@ -204,7 +204,7 @@ class DhcpAgent(manager.Manager):
204 # we notify all ports in case some were created while the agent 204 # we notify all ports in case some were created while the agent
205 # was down 205 # was down
206 self.dhcp_ready_ports |= set(self.cache.get_port_ids(only_nets)) 206 self.dhcp_ready_ports |= set(self.cache.get_port_ids(only_nets))
207 LOG.info(_LI('Synchronizing state complete')) 207 LOG.info('Synchronizing state complete')
208 208
209 except Exception as e: 209 except Exception as e:
210 if only_nets: 210 if only_nets:
@@ -212,7 +212,7 @@ class DhcpAgent(manager.Manager):
212 self.schedule_resync(e, network_id) 212 self.schedule_resync(e, network_id)
213 else: 213 else:
214 self.schedule_resync(e) 214 self.schedule_resync(e)
215 LOG.exception(_LE('Unable to sync network state.')) 215 LOG.exception('Unable to sync network state.')
216 216
217 def _dhcp_ready_ports_loop(self): 217 def _dhcp_ready_ports_loop(self):
218 """Notifies the server of any ports that had reservations setup.""" 218 """Notifies the server of any ports that had reservations setup."""
@@ -226,12 +226,12 @@ class DhcpAgent(manager.Manager):
226 self.plugin_rpc.dhcp_ready_on_ports(ports_to_send) 226 self.plugin_rpc.dhcp_ready_on_ports(ports_to_send)
227 continue 227 continue
228 except oslo_messaging.MessagingTimeout: 228 except oslo_messaging.MessagingTimeout:
229 LOG.error(_LE("Timeout notifying server of ports ready. " 229 LOG.error("Timeout notifying server of ports ready. "
230 "Retrying...")) 230 "Retrying...")
231 except Exception: 231 except Exception:
232 LOG.exception(_LE("Failure notifying DHCP server of " 232 LOG.exception("Failure notifying DHCP server of "
233 "ready DHCP ports. Will retry on next " 233 "ready DHCP ports. Will retry on next "
234 "iteration.")) 234 "iteration.")
235 self.dhcp_ready_ports |= ports_to_send 235 self.dhcp_ready_ports |= ports_to_send
236 236
237 def start_ready_ports_loop(self): 237 def start_ready_ports_loop(self):
@@ -267,7 +267,7 @@ class DhcpAgent(manager.Manager):
267 return network 267 return network
268 except Exception as e: 268 except Exception as e:
269 self.schedule_resync(e, network_id) 269 self.schedule_resync(e, network_id)
270 LOG.exception(_LE('Network %s info call failed.'), network_id) 270 LOG.exception('Network %s info call failed.', network_id)
271 271
272 def enable_dhcp_helper(self, network_id): 272 def enable_dhcp_helper(self, network_id):
273 """Enable DHCP for a network that meets enabling criteria.""" 273 """Enable DHCP for a network that meets enabling criteria."""
@@ -279,12 +279,12 @@ class DhcpAgent(manager.Manager):
279 def safe_configure_dhcp_for_network(self, network): 279 def safe_configure_dhcp_for_network(self, network):
280 try: 280 try:
281 network_id = network.get('id') 281 network_id = network.get('id')
282 LOG.info(_LI('Starting network %s dhcp configuration'), network_id) 282 LOG.info('Starting network %s dhcp configuration', network_id)
283 self.configure_dhcp_for_network(network) 283 self.configure_dhcp_for_network(network)
284 LOG.info(_LI('Finished network %s dhcp configuration'), network_id) 284 LOG.info('Finished network %s dhcp configuration', network_id)
285 except (exceptions.NetworkNotFound, RuntimeError): 285 except (exceptions.NetworkNotFound, RuntimeError):
286 LOG.warning(_LW('Network %s may have been deleted and ' 286 LOG.warning('Network %s may have been deleted and '
287 'its resources may have already been disposed.'), 287 'its resources may have already been disposed.',
288 network.id) 288 network.id)
289 289
290 def configure_dhcp_for_network(self, network): 290 def configure_dhcp_for_network(self, network):
@@ -411,7 +411,7 @@ class DhcpAgent(manager.Manager):
411 network = self.cache.get_network_by_id(updated_port.network_id) 411 network = self.cache.get_network_by_id(updated_port.network_id)
412 if not network: 412 if not network:
413 return 413 return
414 LOG.info(_LI("Trigger reload_allocations for port %s"), 414 LOG.info("Trigger reload_allocations for port %s",
415 updated_port) 415 updated_port)
416 driver_action = 'reload_allocations' 416 driver_action = 'reload_allocations'
417 if self._is_port_on_this_agent(updated_port): 417 if self._is_port_on_this_agent(updated_port):
@@ -498,10 +498,10 @@ class DhcpAgent(manager.Manager):
498 if router_ports: 498 if router_ports:
499 # Multiple router ports should not be allowed 499 # Multiple router ports should not be allowed
500 if len(router_ports) > 1: 500 if len(router_ports) > 1:
501 LOG.warning(_LW("%(port_num)d router ports found on the " 501 LOG.warning("%(port_num)d router ports found on the "
502 "metadata access network. Only the port " 502 "metadata access network. Only the port "
503 "%(port_id)s, for router %(router_id)s " 503 "%(port_id)s, for router %(router_id)s "
504 "will be considered"), 504 "will be considered",
505 {'port_num': len(router_ports), 505 {'port_num': len(router_ports),
506 'port_id': router_ports[0].id, 506 'port_id': router_ports[0].id,
507 'router_id': router_ports[0].device_id}) 507 'router_id': router_ports[0].device_id})
@@ -733,18 +733,18 @@ class DhcpAgentWithStateReport(DhcpAgent):
733 agent_status = self.state_rpc.report_state( 733 agent_status = self.state_rpc.report_state(
734 ctx, self.agent_state, True) 734 ctx, self.agent_state, True)
735 if agent_status == n_const.AGENT_REVIVED: 735 if agent_status == n_const.AGENT_REVIVED:
736 LOG.info(_LI("Agent has just been revived. " 736 LOG.info("Agent has just been revived. "
737 "Scheduling full sync")) 737 "Scheduling full sync")
738 self.schedule_resync("Agent has just been revived") 738 self.schedule_resync("Agent has just been revived")
739 except AttributeError: 739 except AttributeError:
740 # This means the server does not support report_state 740 # This means the server does not support report_state
741 LOG.warning(_LW("Neutron server does not support state report. " 741 LOG.warning("Neutron server does not support state report. "
742 "State report for this agent will be disabled.")) 742 "State report for this agent will be disabled.")
743 self.heartbeat.stop() 743 self.heartbeat.stop()
744 self.run() 744 self.run()
745 return 745 return
746 except Exception: 746 except Exception:
747 LOG.exception(_LE("Failed reporting state!")) 747 LOG.exception("Failed reporting state!")
748 return 748 return
749 if self.agent_state.pop('start_flag', None): 749 if self.agent_state.pop('start_flag', None):
750 self.run() 750 self.run()
@@ -753,7 +753,7 @@ class DhcpAgentWithStateReport(DhcpAgent):
753 """Handle the agent_updated notification event.""" 753 """Handle the agent_updated notification event."""
754 self.schedule_resync(_("Agent updated: %(payload)s") % 754 self.schedule_resync(_("Agent updated: %(payload)s") %
755 {"payload": payload}) 755 {"payload": payload})
756 LOG.info(_LI("agent_updated by server side %s!"), payload) 756 LOG.info("agent_updated by server side %s!", payload)
757 757
758 def after_start(self): 758 def after_start(self):
759 LOG.info(_LI("DHCP agent started")) 759 LOG.info("DHCP agent started")
diff --git a/neutron/agent/l2/extensions/fdb_population.py b/neutron/agent/l2/extensions/fdb_population.py
index 9e34ab8..2c2f525 100644
--- a/neutron/agent/l2/extensions/fdb_population.py
+++ b/neutron/agent/l2/extensions/fdb_population.py
@@ -20,7 +20,6 @@ from neutron_lib.utils import helpers
20from oslo_config import cfg 20from oslo_config import cfg
21from oslo_log import log as logging 21from oslo_log import log as logging
22 22
23from neutron._i18n import _LE, _LW
24from neutron.agent.l2 import l2_agent_extension 23from neutron.agent.l2 import l2_agent_extension
25from neutron.agent.linux import bridge_lib 24from neutron.agent.linux import bridge_lib
26from neutron.conf.agent import l2_ext_fdb_population 25from neutron.conf.agent import l2_ext_fdb_population
@@ -73,9 +72,9 @@ class FdbPopulationAgentExtension(
73 try: 72 try:
74 _stdout = bridge_lib.FdbInterface.show(device) 73 _stdout = bridge_lib.FdbInterface.show(device)
75 except RuntimeError as e: 74 except RuntimeError as e:
76 LOG.warning(_LW( 75 LOG.warning(
77 'Unable to find FDB Interface %(device)s. ' 76 'Unable to find FDB Interface %(device)s. '
78 'Exception: %(e)s'), {'device': device, 'e': e}) 77 'Exception: %(e)s', {'device': device, 'e': e})
79 continue 78 continue
80 self.device_to_macs[device] = _stdout.split()[::3] 79 self.device_to_macs[device] = _stdout.split()[::3]
81 80
@@ -94,10 +93,10 @@ class FdbPopulationAgentExtension(
94 try: 93 try:
95 bridge_lib.FdbInterface.add(mac, device) 94 bridge_lib.FdbInterface.add(mac, device)
96 except RuntimeError as e: 95 except RuntimeError as e:
97 LOG.warning(_LW( 96 LOG.warning(
98 'Unable to add mac %(mac)s ' 97 'Unable to add mac %(mac)s '
99 'to FDB Interface %(device)s. ' 98 'to FDB Interface %(device)s. '
100 'Exception: %(e)s'), 99 'Exception: %(e)s',
101 {'mac': mac, 'device': device, 'e': e}) 100 {'mac': mac, 'device': device, 'e': e})
102 return 101 return
103 self.device_to_macs[device].append(mac) 102 self.device_to_macs[device].append(mac)
@@ -105,19 +104,19 @@ class FdbPopulationAgentExtension(
105 def delete_port(self, devices, port_id): 104 def delete_port(self, devices, port_id):
106 mac = self.portid_to_mac.get(port_id) 105 mac = self.portid_to_mac.get(port_id)
107 if mac is None: 106 if mac is None:
108 LOG.warning(_LW('Port Id %(port_id)s does not have a rule for ' 107 LOG.warning('Port Id %(port_id)s does not have a rule for '
109 'devices %(devices)s in FDB table'), 108 'devices %(devices)s in FDB table',
110 {'port_id': port_id, 'devices': devices}) 109 {'port_id': port_id, 'devices': devices})
111 return 110 return
112 for device in devices: 111 for device in devices:
113 if mac in self.device_to_macs[device]: 112 if mac in self.device_to_macs[device]:
114 try: 113 try:
115 bridge_lib.FdbInterface.delete(mac, device) 114 bridge_lib.FdbInterface.delete(mac, device)
116 except RuntimeError as e: 115 except RuntimeError as e:
117 LOG.warning(_LW( 116 LOG.warning(
118 'Unable to delete mac %(mac)s ' 117 'Unable to delete mac %(mac)s '
119 'from FDB Interface %(device)s. ' 118 'from FDB Interface %(device)s. '
120 'Exception: %(e)s'), 119 'Exception: %(e)s',
121 {'mac': mac, 'device': device, 'e': e}) 120 {'mac': mac, 'device': device, 'e': e})
122 return 121 return
123 self.device_to_macs[device].remove(mac) 122 self.device_to_macs[device].remove(mac)
@@ -129,17 +128,17 @@ class FdbPopulationAgentExtension(
129 valid_driver_types = (linux_bridge_constants.EXTENSION_DRIVER_TYPE, 128 valid_driver_types = (linux_bridge_constants.EXTENSION_DRIVER_TYPE,
130 ovs_constants.EXTENSION_DRIVER_TYPE) 129 ovs_constants.EXTENSION_DRIVER_TYPE)
131 if driver_type not in valid_driver_types: 130 if driver_type not in valid_driver_types:
132 LOG.error(_LE('FDB extension is only supported for OVS and ' 131 LOG.error('FDB extension is only supported for OVS and '
133 'linux bridge agent, currently uses ' 132 'linux bridge agent, currently uses '
134 '%(driver_type)s'), {'driver_type': driver_type}) 133 '%(driver_type)s', {'driver_type': driver_type})
135 sys.exit(1) 134 sys.exit(1)
136 135
137 self.device_mappings = helpers.parse_mappings( 136 self.device_mappings = helpers.parse_mappings(
138 cfg.CONF.FDB.shared_physical_device_mappings, unique_keys=False) 137 cfg.CONF.FDB.shared_physical_device_mappings, unique_keys=False)
139 devices = self._get_devices() 138 devices = self._get_devices()
140 if not devices: 139 if not devices:
141 LOG.error(_LE('Invalid configuration provided for FDB extension: ' 140 LOG.error('Invalid configuration provided for FDB extension: '
142 'no physical devices')) 141 'no physical devices')
143 sys.exit(1) 142 sys.exit(1)
144 self.fdb_tracker = self.FdbTableTracker(devices) 143 self.fdb_tracker = self.FdbTableTracker(devices)
145 144
diff --git a/neutron/agent/l2/extensions/qos.py b/neutron/agent/l2/extensions/qos.py
index 590938c..ca3a7f0 100644
--- a/neutron/agent/l2/extensions/qos.py
+++ b/neutron/agent/l2/extensions/qos.py
@@ -20,7 +20,6 @@ from oslo_concurrency import lockutils
20from oslo_log import log as logging 20from oslo_log import log as logging
21import six 21import six
22 22
23from neutron._i18n import _LW, _LI
24from neutron.agent.l2 import l2_agent_extension 23from neutron.agent.l2 import l2_agent_extension
25from neutron.api.rpc.callbacks.consumer import registry 24from neutron.api.rpc.callbacks.consumer import registry
26from neutron.api.rpc.callbacks import events 25from neutron.api.rpc.callbacks import events
@@ -107,8 +106,8 @@ class QosAgentDriver(object):
107 if rule_type in self.SUPPORTED_RULES: 106 if rule_type in self.SUPPORTED_RULES:
108 yield rule 107 yield rule
109 else: 108 else:
110 LOG.warning(_LW('Unsupported QoS rule type for %(rule_id)s: ' 109 LOG.warning('Unsupported QoS rule type for %(rule_id)s: '
111 '%(rule_type)s; skipping'), 110 '%(rule_type)s; skipping',
112 {'rule_id': rule.id, 'rule_type': rule_type}) 111 {'rule_id': rule.id, 'rule_type': rule_type})
113 112
114 def _handle_rule_delete(self, port, rule_type, ingress=False): 113 def _handle_rule_delete(self, port, rule_type, ingress=False):
@@ -261,9 +260,9 @@ class QosAgentExtension(l2_agent_extension.L2AgentExtension):
261 qos_policy = self.resource_rpc.pull( 260 qos_policy = self.resource_rpc.pull(
262 context, resources.QOS_POLICY, qos_policy_id) 261 context, resources.QOS_POLICY, qos_policy_id)
263 if qos_policy is None: 262 if qos_policy is None:
264 LOG.info(_LI("QoS policy %(qos_policy_id)s applied to port " 263 LOG.info("QoS policy %(qos_policy_id)s applied to port "
265 "%(port_id)s is not available on server, " 264 "%(port_id)s is not available on server, "
266 "it has been deleted. Skipping."), 265 "it has been deleted. Skipping.",
267 {'qos_policy_id': qos_policy_id, 'port_id': port_id}) 266 {'qos_policy_id': qos_policy_id, 'port_id': port_id})
268 self._process_reset_port(port) 267 self._process_reset_port(port)
269 else: 268 else:
diff --git a/neutron/agent/l2/l2_agent_extensions_manager.py b/neutron/agent/l2/l2_agent_extensions_manager.py
index 4040b75..8a2511b 100644
--- a/neutron/agent/l2/l2_agent_extensions_manager.py
+++ b/neutron/agent/l2/l2_agent_extensions_manager.py
@@ -12,7 +12,6 @@
12 12
13from oslo_log import log 13from oslo_log import log
14 14
15from neutron._i18n import _LE
16from neutron.agent import agent_extensions_manager as agent_ext_manager 15from neutron.agent import agent_extensions_manager as agent_ext_manager
17from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config 16from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config
18 17
@@ -43,8 +42,8 @@ class L2AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
43 extension.obj.handle_port(context, data) 42 extension.obj.handle_port(context, data)
44 else: 43 else:
45 LOG.error( 44 LOG.error(
46 _LE("Agent Extension '%(name)s' does not " 45 "Agent Extension '%(name)s' does not "
47 "implement method handle_port"), 46 "implement method handle_port",
48 {'name': extension.name} 47 {'name': extension.name}
49 ) 48 )
50 49
@@ -55,7 +54,7 @@ class L2AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
55 extension.obj.delete_port(context, data) 54 extension.obj.delete_port(context, data)
56 else: 55 else:
57 LOG.error( 56 LOG.error(
58 _LE("Agent Extension '%(name)s' does not " 57 "Agent Extension '%(name)s' does not "
59 "implement method delete_port"), 58 "implement method delete_port",
60 {'name': extension.name} 59 {'name': extension.name}
61 ) 60 )
diff --git a/neutron/agent/l3/agent.py b/neutron/agent/l3/agent.py
index 12a3ee3..3e20ed3 100644
--- a/neutron/agent/l3/agent.py
+++ b/neutron/agent/l3/agent.py
@@ -33,7 +33,7 @@ from oslo_utils import excutils
33from oslo_utils import timeutils 33from oslo_utils import timeutils
34from osprofiler import profiler 34from osprofiler import profiler
35 35
36from neutron._i18n import _, _LE, _LI, _LW 36from neutron._i18n import _
37from neutron.agent.common import utils as common_utils 37from neutron.agent.common import utils as common_utils
38from neutron.agent.l3 import dvr 38from neutron.agent.l3 import dvr
39from neutron.agent.l3 import dvr_edge_ha_router 39from neutron.agent.l3 import dvr_edge_ha_router
@@ -221,20 +221,20 @@ class L3NATAgent(ha.AgentMixin,
221 self.neutron_service_plugins = ( 221 self.neutron_service_plugins = (
222 self.plugin_rpc.get_service_plugin_list(self.context)) 222 self.plugin_rpc.get_service_plugin_list(self.context))
223 except oslo_messaging.RemoteError as e: 223 except oslo_messaging.RemoteError as e:
224 LOG.warning(_LW('l3-agent cannot check service plugins ' 224 LOG.warning('l3-agent cannot check service plugins '
225 'enabled at the neutron server when ' 225 'enabled at the neutron server when '
226 'startup due to RPC error. It happens ' 226 'startup due to RPC error. It happens '
227 'when the server does not support this ' 227 'when the server does not support this '
228 'RPC API. If the error is ' 228 'RPC API. If the error is '
229 'UnsupportedVersion you can ignore this ' 229 'UnsupportedVersion you can ignore this '
230 'warning. Detail message: %s'), e) 230 'warning. Detail message: %s', e)
231 self.neutron_service_plugins = None 231 self.neutron_service_plugins = None
232 except oslo_messaging.MessagingTimeout as e: 232 except oslo_messaging.MessagingTimeout as e:
233 LOG.warning(_LW('l3-agent cannot contact neutron server ' 233 LOG.warning('l3-agent cannot contact neutron server '
234 'to retrieve service plugins enabled. ' 234 'to retrieve service plugins enabled. '
235 'Check connectivity to neutron server. ' 235 'Check connectivity to neutron server. '
236 'Retrying... ' 236 'Retrying... '
237 'Detailed message: %(msg)s.'), {'msg': e}) 237 'Detailed message: %(msg)s.', {'msg': e})
238 continue 238 continue
239 break 239 break
240 240
@@ -272,15 +272,15 @@ class L3NATAgent(ha.AgentMixin,
272 The actual values are not verified for correctness. 272 The actual values are not verified for correctness.
273 """ 273 """
274 if not self.conf.interface_driver: 274 if not self.conf.interface_driver:
275 msg = _LE('An interface driver must be specified') 275 msg = 'An interface driver must be specified'
276 LOG.error(msg) 276 LOG.error(msg)
277 raise SystemExit(1) 277 raise SystemExit(1)
278 278
279 if self.conf.ipv6_gateway: 279 if self.conf.ipv6_gateway:
280 # ipv6_gateway configured. Check for valid v6 link-local address. 280 # ipv6_gateway configured. Check for valid v6 link-local address.
281 try: 281 try:
282 msg = _LE("%s used in config as ipv6_gateway is not a valid " 282 msg = ("%s used in config as ipv6_gateway is not a valid "
283 "IPv6 link-local address."), 283 "IPv6 link-local address.")
284 ip_addr = netaddr.IPAddress(self.conf.ipv6_gateway) 284 ip_addr = netaddr.IPAddress(self.conf.ipv6_gateway)
285 if ip_addr.version != 6 or not ip_addr.is_link_local(): 285 if ip_addr.version != 6 or not ip_addr.is_link_local():
286 LOG.error(msg, self.conf.ipv6_gateway) 286 LOG.error(msg, self.conf.ipv6_gateway)
@@ -361,13 +361,13 @@ class L3NATAgent(ha.AgentMixin,
361 except Exception: 361 except Exception:
362 with excutils.save_and_reraise_exception(): 362 with excutils.save_and_reraise_exception():
363 del self.router_info[router_id] 363 del self.router_info[router_id]
364 LOG.exception(_LE('Error while initializing router %s'), 364 LOG.exception('Error while initializing router %s',
365 router_id) 365 router_id)
366 self.namespaces_manager.ensure_router_cleanup(router_id) 366 self.namespaces_manager.ensure_router_cleanup(router_id)
367 try: 367 try:
368 ri.delete() 368 ri.delete()
369 except Exception: 369 except Exception:
370 LOG.exception(_LE('Error while deleting router %s'), 370 LOG.exception('Error while deleting router %s',
371 router_id) 371 router_id)
372 372
373 def _safe_router_removed(self, router_id): 373 def _safe_router_removed(self, router_id):
@@ -377,7 +377,7 @@ class L3NATAgent(ha.AgentMixin,
377 self._router_removed(router_id) 377 self._router_removed(router_id)
378 self.l3_ext_manager.delete_router(self.context, router_id) 378 self.l3_ext_manager.delete_router(self.context, router_id)
379 except Exception: 379 except Exception:
380 LOG.exception(_LE('Error while deleting router %s'), router_id) 380 LOG.exception('Error while deleting router %s', router_id)
381 return False 381 return False
382 else: 382 else:
383 return True 383 return True
@@ -385,8 +385,8 @@ class L3NATAgent(ha.AgentMixin,
385 def _router_removed(self, router_id): 385 def _router_removed(self, router_id):
386 ri = self.router_info.get(router_id) 386 ri = self.router_info.get(router_id)
387 if ri is None: 387 if ri is None:
388 LOG.warning(_LW("Info for router %s was not found. " 388 LOG.warning("Info for router %s was not found. "
389 "Performing router cleanup"), router_id) 389 "Performing router cleanup", router_id)
390 self.namespaces_manager.ensure_router_cleanup(router_id) 390 self.namespaces_manager.ensure_router_cleanup(router_id)
391 return 391 return
392 392
@@ -451,7 +451,7 @@ class L3NATAgent(ha.AgentMixin,
451 def _process_router_if_compatible(self, router): 451 def _process_router_if_compatible(self, router):
452 if (self.conf.external_network_bridge and 452 if (self.conf.external_network_bridge and
453 not ip_lib.device_exists(self.conf.external_network_bridge)): 453 not ip_lib.device_exists(self.conf.external_network_bridge)):
454 LOG.error(_LE("The external network bridge '%s' does not exist"), 454 LOG.error("The external network bridge '%s' does not exist",
455 self.conf.external_network_bridge) 455 self.conf.external_network_bridge)
456 return 456 return
457 457
@@ -513,7 +513,7 @@ class L3NATAgent(ha.AgentMixin,
513 routers = self.plugin_rpc.get_routers(self.context, 513 routers = self.plugin_rpc.get_routers(self.context,
514 [update.id]) 514 [update.id])
515 except Exception: 515 except Exception:
516 msg = _LE("Failed to fetch router information for '%s'") 516 msg = "Failed to fetch router information for '%s'"
517 LOG.exception(msg, update.id) 517 LOG.exception(msg, update.id)
518 self._resync_router(update) 518 self._resync_router(update)
519 continue 519 continue
@@ -540,12 +540,12 @@ class L3NATAgent(ha.AgentMixin,
540 log_verbose_exc(e.msg, router) 540 log_verbose_exc(e.msg, router)
541 # Was the router previously handled by this agent? 541 # Was the router previously handled by this agent?
542 if router['id'] in self.router_info: 542 if router['id'] in self.router_info:
543 LOG.error(_LE("Removing incompatible router '%s'"), 543 LOG.error("Removing incompatible router '%s'",
544 router['id']) 544 router['id'])
545 self._safe_router_removed(router['id']) 545 self._safe_router_removed(router['id'])
546 except Exception: 546 except Exception:
547 log_verbose_exc( 547 log_verbose_exc(
548 _LE("Failed to process compatible router: %s") % update.id, 548 "Failed to process compatible router: %s" % update.id,
549 router) 549 router)
550 self._resync_router(update) 550 self._resync_router(update)
551 continue 551 continue
@@ -632,20 +632,20 @@ class L3NATAgent(ha.AgentMixin,
632 self.sync_routers_chunk_size = max( 632 self.sync_routers_chunk_size = max(
633 self.sync_routers_chunk_size / 2, 633 self.sync_routers_chunk_size / 2,
634 SYNC_ROUTERS_MIN_CHUNK_SIZE) 634 SYNC_ROUTERS_MIN_CHUNK_SIZE)
635 LOG.error(_LE('Server failed to return info for routers in ' 635 LOG.error('Server failed to return info for routers in '
636 'required time, decreasing chunk size to: %s'), 636 'required time, decreasing chunk size to: %s',
637 self.sync_routers_chunk_size) 637 self.sync_routers_chunk_size)
638 else: 638 else:
639 LOG.error(_LE('Server failed to return info for routers in ' 639 LOG.error('Server failed to return info for routers in '
640 'required time even with min chunk size: %s. ' 640 'required time even with min chunk size: %s. '
641 'It might be under very high load or ' 641 'It might be under very high load or '
642 'just inoperable'), 642 'just inoperable',
643 self.sync_routers_chunk_size) 643 self.sync_routers_chunk_size)
644 raise 644 raise
645 except oslo_messaging.MessagingException: 645 except oslo_messaging.MessagingException:
646 failed_routers = chunk or router_ids 646 failed_routers = chunk or router_ids
647 LOG.exception(_LE("Failed synchronizing routers '%s' " 647 LOG.exception("Failed synchronizing routers '%s' "
648 "due to RPC error"), failed_routers) 648 "due to RPC error", failed_routers)
649 raise n_exc.AbortSyncRouters() 649 raise n_exc.AbortSyncRouters()
650 650
651 self.fullsync = False 651 self.fullsync = False
@@ -679,7 +679,7 @@ class L3NATAgent(ha.AgentMixin,
679 # can have L3NATAgentWithStateReport as its base class instead of 679 # can have L3NATAgentWithStateReport as its base class instead of
680 # L3NATAgent. 680 # L3NATAgent.
681 eventlet.spawn_n(self._process_routers_loop) 681 eventlet.spawn_n(self._process_routers_loop)
682 LOG.info(_LI("L3 agent started")) 682 LOG.info("L3 agent started")
683 683
684 def create_pd_router_update(self): 684 def create_pd_router_update(self):
685 router_id = None 685 router_id = None
@@ -741,22 +741,22 @@ class L3NATAgentWithStateReport(L3NATAgent):
741 self.agent_state, 741 self.agent_state,
742 True) 742 True)
743 if agent_status == l3_constants.AGENT_REVIVED: 743 if agent_status == l3_constants.AGENT_REVIVED:
744 LOG.info(_LI('Agent has just been revived. ' 744 LOG.info('Agent has just been revived. '
745 'Doing a full sync.')) 745 'Doing a full sync.')
746 self.fullsync = True 746 self.fullsync = True
747 self.agent_state.pop('start_flag', None) 747 self.agent_state.pop('start_flag', None)
748 except AttributeError: 748 except AttributeError:
749 # This means the server does not support report_state 749 # This means the server does not support report_state
750 LOG.warning(_LW("Neutron server does not support state report. " 750 LOG.warning("Neutron server does not support state report. "
751 "State report for this agent will be disabled.")) 751 "State report for this agent will be disabled.")
752 self.heartbeat.stop() 752 self.heartbeat.stop()
753 return 753 return
754 except Exception: 754 except Exception:
755 LOG.exception(_LE("Failed reporting state!")) 755 LOG.exception("Failed reporting state!")
756 756
757 def after_start(self): 757 def after_start(self):
758 eventlet.spawn_n(self._process_routers_loop) 758 eventlet.spawn_n(self._process_routers_loop)
759 LOG.info(_LI("L3 agent started")) 759 LOG.info("L3 agent started")
760 # Do the report state before we do the first full sync. 760 # Do the report state before we do the first full sync.
761 self._report_state() 761 self._report_state()
762 762
@@ -765,4 +765,4 @@ class L3NATAgentWithStateReport(L3NATAgent):
765 def agent_updated(self, context, payload): 765 def agent_updated(self, context, payload):
766 """Handle the agent_updated notification event.""" 766 """Handle the agent_updated notification event."""
767 self.fullsync = True 767 self.fullsync = True
768 LOG.info(_LI("agent_updated by server side %s!"), payload) 768 LOG.info("agent_updated by server side %s!", payload)
diff --git a/neutron/agent/l3/dvr_edge_router.py b/neutron/agent/l3/dvr_edge_router.py
index 6287a28..9e6125e 100644
--- a/neutron/agent/l3/dvr_edge_router.py
+++ b/neutron/agent/l3/dvr_edge_router.py
@@ -15,7 +15,6 @@
15from neutron_lib import constants as lib_constants 15from neutron_lib import constants as lib_constants
16from oslo_log import log as logging 16from oslo_log import log as logging
17 17
18from neutron._i18n import _LE
19from neutron.agent.l3 import dvr_local_router 18from neutron.agent.l3 import dvr_local_router
20from neutron.agent.l3 import dvr_snat_ns 19from neutron.agent.l3 import dvr_snat_ns
21from neutron.agent.l3 import router_info as router 20from neutron.agent.l3 import router_info as router
@@ -211,8 +210,8 @@ class DvrEdgeRouter(dvr_local_router.DvrLocalRouter):
211 super(DvrEdgeRouter, self)._update_routing_table( 210 super(DvrEdgeRouter, self)._update_routing_table(
212 operation, route, namespace=ns_name) 211 operation, route, namespace=ns_name)
213 else: 212 else:
214 LOG.error(_LE("The SNAT namespace %s does not exist for " 213 LOG.error("The SNAT namespace %s does not exist for "
215 "the router."), ns_name) 214 "the router.", ns_name)
216 super(DvrEdgeRouter, self).update_routing_table(operation, route) 215 super(DvrEdgeRouter, self).update_routing_table(operation, route)
217 216
218 def delete(self): 217 def delete(self):
diff --git a/neutron/agent/l3/dvr_fip_ns.py b/neutron/agent/l3/dvr_fip_ns.py
index 327fc73..47db521 100644
--- a/neutron/agent/l3/dvr_fip_ns.py
+++ b/neutron/agent/l3/dvr_fip_ns.py
@@ -20,7 +20,7 @@ from oslo_concurrency import lockutils
20from oslo_log import log as logging 20from oslo_log import log as logging
21from oslo_utils import excutils 21from oslo_utils import excutils
22 22
23from neutron._i18n import _, _LE, _LW 23from neutron._i18n import _
24from neutron.agent.l3 import fip_rule_priority_allocator as frpa 24from neutron.agent.l3 import fip_rule_priority_allocator as frpa
25from neutron.agent.l3 import link_local_allocator as lla 25from neutron.agent.l3 import link_local_allocator as lla
26from neutron.agent.l3 import namespaces 26from neutron.agent.l3 import namespaces
@@ -117,8 +117,8 @@ class FipNamespace(namespaces.Namespace):
117 yield 117 yield
118 except Exception: 118 except Exception:
119 with excutils.save_and_reraise_exception(): 119 with excutils.save_and_reraise_exception():
120 LOG.error(_LE('DVR: FIP namespace config failure ' 120 LOG.error('DVR: FIP namespace config failure '
121 'for interface %s'), interface_name) 121 'for interface %s', interface_name)
122 122
123 def create_or_update_gateway_port(self, agent_gateway_port): 123 def create_or_update_gateway_port(self, agent_gateway_port):
124 interface_name = self.get_ext_device_name(agent_gateway_port['id']) 124 interface_name = self.get_ext_device_name(agent_gateway_port['id'])
@@ -147,8 +147,8 @@ class FipNamespace(namespaces.Namespace):
147 with excutils.save_and_reraise_exception(): 147 with excutils.save_and_reraise_exception():
148 self.unsubscribe(agent_gateway_port['network_id']) 148 self.unsubscribe(agent_gateway_port['network_id'])
149 self.delete() 149 self.delete()
150 LOG.exception(_LE('DVR: Gateway update in ' 150 LOG.exception('DVR: Gateway update in '
151 'FIP namespace failed')) 151 'FIP namespace failed')
152 152
153 def _create_gateway_port(self, ex_gw_port, interface_name): 153 def _create_gateway_port(self, ex_gw_port, interface_name):
154 """Create namespace, request port creationg from Plugin, 154 """Create namespace, request port creationg from Plugin,
@@ -296,8 +296,8 @@ class FipNamespace(namespaces.Namespace):
296 with excutils.save_and_reraise_exception(): 296 with excutils.save_and_reraise_exception():
297 self.unsubscribe(self.agent_gateway_port['network_id']) 297 self.unsubscribe(self.agent_gateway_port['network_id'])
298 self.agent_gateway_port = None 298 self.agent_gateway_port = None
299 LOG.exception(_LE('DVR: Gateway setup in FIP namespace ' 299 LOG.exception('DVR: Gateway setup in FIP namespace '
300 'failed')) 300 'failed')
301 301
302 # Now add the filter match rule for the table. 302 # Now add the filter match rule for the table.
303 ip_rule = ip_lib.IPRule(namespace=self.get_name()) 303 ip_rule = ip_lib.IPRule(namespace=self.get_name())
@@ -328,10 +328,10 @@ class FipNamespace(namespaces.Namespace):
328 # throw exceptions. Unsubscribe this external network so that 328 # throw exceptions. Unsubscribe this external network so that
329 # the next call will trigger the interface to be plugged. 329 # the next call will trigger the interface to be plugged.
330 if not ipd.exists(): 330 if not ipd.exists():
331 LOG.warning(_LW('DVR: FIP gateway port with interface ' 331 LOG.warning('DVR: FIP gateway port with interface '
332 'name: %(device)s does not exist in the given ' 332 'name: %(device)s does not exist in the given '
333 'namespace: %(ns)s'), {'device': interface_name, 333 'namespace: %(ns)s', {'device': interface_name,
334 'ns': ns_name}) 334 'ns': ns_name})
335 msg = _('DVR: Gateway update route in FIP namespace failed, retry ' 335 msg = _('DVR: Gateway update route in FIP namespace failed, retry '
336 'should be attempted on next call') 336 'should be attempted on next call')
337 raise n_exc.FloatingIpSetupException(msg) 337 raise n_exc.FloatingIpSetupException(msg)
diff --git a/neutron/agent/l3/dvr_local_router.py b/neutron/agent/l3/dvr_local_router.py
index c8fea76..ae46c86 100644
--- a/neutron/agent/l3/dvr_local_router.py
+++ b/neutron/agent/l3/dvr_local_router.py
@@ -22,7 +22,6 @@ from oslo_log import log as logging
22from oslo_utils import excutils 22from oslo_utils import excutils
23import six 23import six
24 24
25from neutron._i18n import _LE, _LW
26from neutron.agent.l3 import dvr_fip_ns 25from neutron.agent.l3 import dvr_fip_ns
27from neutron.agent.l3 import dvr_router_base 26from neutron.agent.l3 import dvr_router_base
28from neutron.agent.linux import ip_lib 27from neutron.agent.linux import ip_lib
@@ -239,16 +238,16 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
239 return True 238 return True
240 else: 239 else:
241 if operation == 'add': 240 if operation == 'add':
242 LOG.warning(_LW("Device %s does not exist so ARP entry " 241 LOG.warning("Device %s does not exist so ARP entry "
243 "cannot be updated, will cache " 242 "cannot be updated, will cache "
244 "information to be applied later " 243 "information to be applied later "
245 "when the device exists"), 244 "when the device exists",
246 device) 245 device)
247 self._cache_arp_entry(ip, mac, subnet_id, operation) 246 self._cache_arp_entry(ip, mac, subnet_id, operation)
248 return False 247 return False
249 except Exception: 248 except Exception:
250 with excutils.save_and_reraise_exception(): 249 with excutils.save_and_reraise_exception():
251 LOG.exception(_LE("DVR: Failed updating arp entry")) 250 LOG.exception("DVR: Failed updating arp entry")
252 251
253 def _set_subnet_arp_info(self, subnet_id): 252 def _set_subnet_arp_info(self, subnet_id):
254 """Set ARP info retrieved from Plugin for existing ports.""" 253 """Set ARP info retrieved from Plugin for existing ports."""
@@ -356,10 +355,10 @@ class DvrLocalRouter(dvr_router_base.DvrRouterBase):
356 priority=snat_idx) 355 priority=snat_idx)
357 except Exception: 356 except Exception:
358 if is_add: 357 if is_add:
359 exc = _LE('DVR: error adding redirection logic') 358 exc = 'DVR: error adding redirection logic'
360 else: 359 else:
361 exc = _LE('DVR: snat remove failed to clear the rule ' 360 exc = ('DVR: snat remove failed to clear the rule '
362 'and device') 361 'and device')
363 LOG.exception(exc) 362 LOG.exception(exc)
364 363
365 def _snat_redirect_add(self, gateway, sn_port, sn_int): 364 def _snat_redirect_add(self, gateway, sn_port, sn_int):
diff --git a/neutron/agent/l3/dvr_router_base.py b/neutron/agent/l3/dvr_router_base.py
index dcb0663..9f1ba5a1e 100644
--- a/neutron/agent/l3/dvr_router_base.py
+++ b/neutron/agent/l3/dvr_router_base.py
@@ -12,7 +12,6 @@
12 12
13from oslo_log import log as logging 13from oslo_log import log as logging
14 14
15from neutron._i18n import _LE
16from neutron.agent.l3 import router_info as router 15from neutron.agent.l3 import router_info as router
17from neutron.common import constants as l3_constants 16from neutron.common import constants as l3_constants
18 17
@@ -47,8 +46,8 @@ class DvrRouterBase(router.RouterInfo):
47 if ip['subnet_id'] in subnet_ids: 46 if ip['subnet_id'] in subnet_ids:
48 return p 47 return p
49 48
50 LOG.error(_LE('DVR: SNAT port not found in the list ' 49 LOG.error('DVR: SNAT port not found in the list '
51 '%(snat_list)s for the given router ' 50 '%(snat_list)s for the given router '
52 'internal port %(int_p)s'), { 51 'internal port %(int_p)s', {
53 'snat_list': snat_ports, 52 'snat_list': snat_ports,
54 'int_p': int_port}) 53 'int_p': int_port})
diff --git a/neutron/agent/l3/ha.py b/neutron/agent/l3/ha.py
index d60bb13..795e271 100644
--- a/neutron/agent/l3/ha.py
+++ b/neutron/agent/l3/ha.py
@@ -20,7 +20,6 @@ from oslo_log import log as logging
20from oslo_utils import fileutils 20from oslo_utils import fileutils
21import webob 21import webob
22 22
23from neutron._i18n import _LI
24from neutron.agent.linux import utils as agent_utils 23from neutron.agent.linux import utils as agent_utils
25from neutron.common import constants 24from neutron.common import constants
26from neutron.notifiers import batch_notifier 25from neutron.notifiers import batch_notifier
@@ -88,8 +87,8 @@ class AgentMixin(object):
88 try: 87 try:
89 return self.router_info[router_id] 88 return self.router_info[router_id]
90 except KeyError: 89 except KeyError:
91 LOG.info(_LI('Router %s is not managed by this agent. It was ' 90 LOG.info('Router %s is not managed by this agent. It was '
92 'possibly deleted concurrently.'), router_id) 91 'possibly deleted concurrently.', router_id)
93 92
94 def check_ha_state_for_router(self, router_id, current_state): 93 def check_ha_state_for_router(self, router_id, current_state):
95 ri = self._get_router_info(router_id) 94 ri = self._get_router_info(router_id)
@@ -110,7 +109,7 @@ class AgentMixin(object):
110 return self.conf.ha_vrrp_advert_int 109 return self.conf.ha_vrrp_advert_int
111 110
112 def enqueue_state_change(self, router_id, state): 111 def enqueue_state_change(self, router_id, state):
113 LOG.info(_LI('Router %(router_id)s transitioned to %(state)s'), 112 LOG.info('Router %(router_id)s transitioned to %(state)s',
114 {'router_id': router_id, 113 {'router_id': router_id,
115 'state': state}) 114 'state': state})
116 115
diff --git a/neutron/agent/l3/ha_router.py b/neutron/agent/l3/ha_router.py
index e98cca1..891ffda 100644
--- a/neutron/agent/l3/ha_router.py
+++ b/neutron/agent/l3/ha_router.py
@@ -21,7 +21,6 @@ from neutron_lib.api.definitions import portbindings
21from neutron_lib import constants as n_consts 21from neutron_lib import constants as n_consts
22from oslo_log import log as logging 22from oslo_log import log as logging
23 23
24from neutron._i18n import _, _LE
25from neutron.agent.l3 import namespaces 24from neutron.agent.l3 import namespaces
26from neutron.agent.l3 import router_info as router 25from neutron.agent.l3 import router_info as router
27from neutron.agent.linux import external_process 26from neutron.agent.linux import external_process
@@ -93,7 +92,7 @@ class HaRouter(router.RouterInfo):
93 with open(ha_state_path, 'w') as f: 92 with open(ha_state_path, 'w') as f:
94 f.write(new_state) 93 f.write(new_state)
95 except (OSError, IOError): 94 except (OSError, IOError):
96 LOG.error(_LE('Error while writing HA state for %s'), 95 LOG.error('Error while writing HA state for %s',
97 self.router_id) 96 self.router_id)
98 97
99 @property 98 @property
@@ -112,8 +111,8 @@ class HaRouter(router.RouterInfo):
112 def initialize(self, process_monitor): 111 def initialize(self, process_monitor):
113 ha_port = self.router.get(n_consts.HA_INTERFACE_KEY) 112 ha_port = self.router.get(n_consts.HA_INTERFACE_KEY)
114 if not ha_port: 113 if not ha_port:
115 msg = _("Unable to process HA router %s without " 114 msg = ("Unable to process HA router %s without HA port" %
116 "HA port") % self.router_id 115 self.router_id)
117 LOG.exception(msg) 116 LOG.exception(msg)
118 raise Exception(msg) 117 raise Exception(msg)
119 super(HaRouter, self).initialize(process_monitor) 118 super(HaRouter, self).initialize(process_monitor)
diff --git a/neutron/agent/l3/item_allocator.py b/neutron/agent/l3/item_allocator.py
index ebf228d..6454344 100644
--- a/neutron/agent/l3/item_allocator.py
+++ b/neutron/agent/l3/item_allocator.py
@@ -16,7 +16,6 @@ import os
16 16
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron._i18n import _LW
20 19
21LOG = logging.getLogger(__name__) 20LOG = logging.getLogger(__name__)
22 21
@@ -55,8 +54,8 @@ class ItemAllocator(object):
55 self.remembered[key] = self.ItemClass(saved_value) 54 self.remembered[key] = self.ItemClass(saved_value)
56 except ValueError: 55 except ValueError:
57 read_error = True 56 read_error = True
58 LOG.warning(_LW("Invalid line in %(file)s, " 57 LOG.warning("Invalid line in %(file)s, "
59 "ignoring: %(line)s"), 58 "ignoring: %(line)s",
60 {'file': state_file, 'line': line}) 59 {'file': state_file, 'line': line})
61 60
62 self.pool.difference_update(self.remembered.values()) 61 self.pool.difference_update(self.remembered.values())
diff --git a/neutron/agent/l3/keepalived_state_change.py b/neutron/agent/l3/keepalived_state_change.py
index e31042d..43e6821 100644
--- a/neutron/agent/l3/keepalived_state_change.py
+++ b/neutron/agent/l3/keepalived_state_change.py
@@ -21,7 +21,7 @@ import netaddr
21from oslo_config import cfg 21from oslo_config import cfg
22from oslo_log import log as logging 22from oslo_log import log as logging
23 23
24from neutron._i18n import _, _LE 24from neutron._i18n import _
25from neutron.agent.l3 import ha 25from neutron.agent.l3 import ha
26from neutron.agent.linux import daemon 26from neutron.agent.linux import daemon
27from neutron.agent.linux import ip_lib 27from neutron.agent.linux import ip_lib
@@ -86,8 +86,8 @@ class MonitorDaemon(daemon.Daemon):
86 # Remove this code once new keepalived versions are available. 86 # Remove this code once new keepalived versions are available.
87 self.send_garp(event) 87 self.send_garp(event)
88 except Exception: 88 except Exception:
89 LOG.exception(_LE( 89 LOG.exception('Failed to process or handle event for line %s',
90 'Failed to process or handle event for line %s'), iterable) 90 iterable)
91 91
92 def write_state_change(self, state): 92 def write_state_change(self, state):
93 with open(os.path.join( 93 with open(os.path.join(
diff --git a/neutron/agent/l3/l3_agent_extensions_manager.py b/neutron/agent/l3/l3_agent_extensions_manager.py
index 1f60b01..d2e0e87 100644
--- a/neutron/agent/l3/l3_agent_extensions_manager.py
+++ b/neutron/agent/l3/l3_agent_extensions_manager.py
@@ -15,7 +15,6 @@
15 15
16from oslo_log import log 16from oslo_log import log
17 17
18from neutron._i18n import _LE
19from neutron.agent import agent_extensions_manager as agent_ext_manager 18from neutron.agent import agent_extensions_manager as agent_ext_manager
20from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config 19from neutron.conf.agent import agent_extensions_manager as agent_ext_mgr_config
21 20
@@ -43,8 +42,8 @@ class L3AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
43 extension.obj.add_router(context, data) 42 extension.obj.add_router(context, data)
44 else: 43 else:
45 LOG.error( 44 LOG.error(
46 _LE("Agent Extension '%(name)s' does not " 45 "Agent Extension '%(name)s' does not "
47 "implement method add_router"), 46 "implement method add_router",
48 {'name': extension.name} 47 {'name': extension.name}
49 ) 48 )
50 49
@@ -55,8 +54,8 @@ class L3AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
55 extension.obj.update_router(context, data) 54 extension.obj.update_router(context, data)
56 else: 55 else:
57 LOG.error( 56 LOG.error(
58 _LE("Agent Extension '%(name)s' does not " 57 "Agent Extension '%(name)s' does not "
59 "implement method update_router"), 58 "implement method update_router",
60 {'name': extension.name} 59 {'name': extension.name}
61 ) 60 )
62 61
@@ -67,7 +66,7 @@ class L3AgentExtensionsManager(agent_ext_manager.AgentExtensionsManager):
67 extension.obj.delete_router(context, data) 66 extension.obj.delete_router(context, data)
68 else: 67 else:
69 LOG.error( 68 LOG.error(
70 _LE("Agent Extension '%(name)s' does not " 69 "Agent Extension '%(name)s' does not "
71 "implement method delete_router"), 70 "implement method delete_router",
72 {'name': extension.name} 71 {'name': extension.name}
73 ) 72 )
diff --git a/neutron/agent/l3/namespace_manager.py b/neutron/agent/l3/namespace_manager.py
index 79c28be..bc42be9 100644
--- a/neutron/agent/l3/namespace_manager.py
+++ b/neutron/agent/l3/namespace_manager.py
@@ -12,7 +12,6 @@
12 12
13from oslo_log import log as logging 13from oslo_log import log as logging
14 14
15from neutron._i18n import _LE
16from neutron.agent.l3 import dvr_fip_ns 15from neutron.agent.l3 import dvr_fip_ns
17from neutron.agent.l3 import dvr_snat_ns 16from neutron.agent.l3 import dvr_snat_ns
18from neutron.agent.l3 import namespaces 17from neutron.agent.l3 import namespaces
@@ -119,8 +118,8 @@ class NamespaceManager(object):
119 namespaces = root_ip.get_namespaces() 118 namespaces = root_ip.get_namespaces()
120 return set(ns for ns in namespaces if self.is_managed(ns)) 119 return set(ns for ns in namespaces if self.is_managed(ns))
121 except RuntimeError: 120 except RuntimeError:
122 LOG.exception(_LE('RuntimeError in obtaining namespace list for ' 121 LOG.exception('RuntimeError in obtaining namespace list for '
123 'namespace cleanup.')) 122 'namespace cleanup.')
124 return set() 123 return set()
125 124
126 def ensure_router_cleanup(self, router_id): 125 def ensure_router_cleanup(self, router_id):
@@ -144,4 +143,4 @@ class NamespaceManager(object):
144 self.process_monitor, ns_id, self.agent_conf, ns.name) 143 self.process_monitor, ns_id, self.agent_conf, ns.name)
145 ns.delete() 144 ns.delete()
146 except RuntimeError: 145 except RuntimeError:
147 LOG.exception(_LE('Failed to destroy stale namespace %s'), ns) 146 LOG.exception('Failed to destroy stale namespace %s', ns)
diff --git a/neutron/agent/l3/namespaces.py b/neutron/agent/l3/namespaces.py
index 9be4efc..71e8cbc 100644
--- a/neutron/agent/l3/namespaces.py
+++ b/neutron/agent/l3/namespaces.py
@@ -18,7 +18,6 @@ import functools
18from oslo_log import log as logging 18from oslo_log import log as logging
19from oslo_utils import excutils 19from oslo_utils import excutils
20 20
21from neutron._i18n import _LE, _LW
22from neutron.agent.linux import ip_lib 21from neutron.agent.linux import ip_lib
23 22
24LOG = logging.getLogger(__name__) 23LOG = logging.getLogger(__name__)
@@ -65,8 +64,8 @@ def check_ns_existence(f):
65 @functools.wraps(f) 64 @functools.wraps(f)
66 def wrapped(self, *args, **kwargs): 65 def wrapped(self, *args, **kwargs):
67 if not self.exists(): 66 if not self.exists():
68 LOG.warning(_LW('Namespace %(name)s does not exist. Skipping ' 67 LOG.warning('Namespace %(name)s does not exist. Skipping '
69 '%(func)s'), 68 '%(func)s',
70 {'name': self.name, 'func': f.__name__}) 69 {'name': self.name, 'func': f.__name__})
71 return 70 return
72 try: 71 try:
@@ -111,7 +110,7 @@ class Namespace(object):
111 try: 110 try:
112 self.ip_wrapper_root.netns.delete(self.name) 111 self.ip_wrapper_root.netns.delete(self.name)
113 except RuntimeError: 112 except RuntimeError:
114 msg = _LE('Failed trying to delete namespace: %s') 113 msg = 'Failed trying to delete namespace: %s'
115 LOG.exception(msg, self.name) 114 LOG.exception(msg, self.name)
116 115
117 def exists(self): 116 def exists(self):
diff --git a/neutron/agent/l3/router_info.py b/neutron/agent/l3/router_info.py
index cf9ff63..0f49d16 100644
--- a/neutron/agent/l3/router_info.py
+++ b/neutron/agent/l3/router_info.py
@@ -19,7 +19,7 @@ from neutron_lib import constants as lib_constants
19from neutron_lib.utils import helpers 19from neutron_lib.utils import helpers
20from oslo_log import log as logging 20from oslo_log import log as logging
21 21
22from neutron._i18n import _, _LE, _LW 22from neutron._i18n import _
23from neutron.agent.l3 import namespaces 23from neutron.agent.l3 import namespaces
24from neutron.agent.linux import ip_lib 24from neutron.agent.linux import ip_lib
25from neutron.agent.linux import iptables_manager 25from neutron.agent.linux import iptables_manager
@@ -298,8 +298,8 @@ class RouterInfo(object):
298 except RuntimeError: 298 except RuntimeError:
299 # any exception occurred here should cause the floating IP 299 # any exception occurred here should cause the floating IP
300 # to be set in error state 300 # to be set in error state
301 LOG.warning(_LW("Unable to configure IP address for " 301 LOG.warning("Unable to configure IP address for "
302 "floating IP: %s"), fip['id']) 302 "floating IP: %s", fip['id'])
303 303
304 def add_floating_ip(self, fip, interface_name, device): 304 def add_floating_ip(self, fip, interface_name, device):
305 raise NotImplementedError() 305 raise NotImplementedError()
@@ -882,7 +882,7 @@ class RouterInfo(object):
882 882
883 except n_exc.FloatingIpSetupException: 883 except n_exc.FloatingIpSetupException:
884 # All floating IPs must be put in error state 884 # All floating IPs must be put in error state
885 LOG.exception(_LE("Failed to process floating IPs.")) 885 LOG.exception("Failed to process floating IPs.")
886 fip_statuses = self.put_fips_in_error_state() 886 fip_statuses = self.put_fips_in_error_state()
887 finally: 887 finally:
888 self.update_fip_statuses(fip_statuses) 888 self.update_fip_statuses(fip_statuses)
@@ -908,7 +908,7 @@ class RouterInfo(object):
908 except (n_exc.FloatingIpSetupException, 908 except (n_exc.FloatingIpSetupException,
909 n_exc.IpTablesApplyException): 909 n_exc.IpTablesApplyException):
910 # All floating IPs must be put in error state 910 # All floating IPs must be put in error state
911 LOG.exception(_LE("Failed to process floating IPs.")) 911 LOG.exception("Failed to process floating IPs.")
912 fip_statuses = self.put_fips_in_error_state() 912 fip_statuses = self.put_fips_in_error_state()
913 finally: 913 finally:
914 self.update_fip_statuses(fip_statuses) 914 self.update_fip_statuses(fip_statuses)
@@ -1102,8 +1102,8 @@ class RouterInfo(object):
1102 self.agent.pd.sync_router(self.router['id']) 1102 self.agent.pd.sync_router(self.router['id'])
1103 self._process_external_on_delete() 1103 self._process_external_on_delete()
1104 else: 1104 else:
1105 LOG.warning(_LW("Can't gracefully delete the router %s: " 1105 LOG.warning("Can't gracefully delete the router %s: "
1106 "no router namespace found."), self.router['id']) 1106 "no router namespace found.", self.router['id'])
1107 1107
1108 @common_utils.exception_logger() 1108 @common_utils.exception_logger()
1109 def process(self): 1109 def process(self):
diff --git a/neutron/agent/linux/async_process.py b/neutron/agent/linux/async_process.py
index 21af640..1e138da 100644
--- a/neutron/agent/linux/async_process.py
+++ b/neutron/agent/linux/async_process.py
@@ -20,7 +20,7 @@ import eventlet.queue
20from neutron_lib.utils import helpers 20from neutron_lib.utils import helpers
21from oslo_log import log as logging 21from oslo_log import log as logging
22 22
23from neutron._i18n import _, _LE 23from neutron._i18n import _
24from neutron.agent.linux import ip_lib 24from neutron.agent.linux import ip_lib
25from neutron.agent.linux import utils 25from neutron.agent.linux import utils
26from neutron.common import utils as common_utils 26from neutron.common import utils as common_utils
@@ -182,7 +182,7 @@ class AsyncProcess(object):
182 # root and need to be killed via the same helper. 182 # root and need to be killed via the same helper.
183 utils.kill_process(pid, kill_signal, self.run_as_root) 183 utils.kill_process(pid, kill_signal, self.run_as_root)
184 except Exception: 184 except Exception:
185 LOG.exception(_LE('An error occurred while killing [%s].'), 185 LOG.exception('An error occurred while killing [%s].',
186 self.cmd) 186 self.cmd)
187 return False 187 return False
188 188
@@ -211,8 +211,8 @@ class AsyncProcess(object):
211 if not output and output != "": 211 if not output and output != "":
212 break 212 break
213 except Exception: 213 except Exception:
214 LOG.exception(_LE('An error occurred while communicating ' 214 LOG.exception('An error occurred while communicating '
215 'with async process [%s].'), self.cmd) 215 'with async process [%s].', self.cmd)
216 break 216 break
217 # Ensure that watching a process with lots of output does 217 # Ensure that watching a process with lots of output does
218 # not block execution of other greenthreads. 218 # not block execution of other greenthreads.
@@ -242,11 +242,11 @@ class AsyncProcess(object):
242 def _read_stderr(self): 242 def _read_stderr(self):
243 data = self._read(self._process.stderr, self._stderr_lines) 243 data = self._read(self._process.stderr, self._stderr_lines)
244 if self.log_output: 244 if self.log_output:
245 LOG.error(_LE('Error received from [%(cmd)s]: %(err)s'), 245 LOG.error('Error received from [%(cmd)s]: %(err)s',
246 {'cmd': self.cmd, 246 {'cmd': self.cmd,
247 'err': data}) 247 'err': data})
248 if self.die_on_error: 248 if self.die_on_error:
249 LOG.error(_LE("Process [%(cmd)s] dies due to the error: %(err)s"), 249 LOG.error("Process [%(cmd)s] dies due to the error: %(err)s",
250 {'cmd': self.cmd, 250 {'cmd': self.cmd,
251 'err': data}) 251 'err': data})
252 # the callback caller will use None to indicate the need to bail 252 # the callback caller will use None to indicate the need to bail
diff --git a/neutron/agent/linux/daemon.py b/neutron/agent/linux/daemon.py
index 8f5e4a7..568c0e1 100644
--- a/neutron/agent/linux/daemon.py
+++ b/neutron/agent/linux/daemon.py
@@ -25,7 +25,7 @@ import sys
25from debtcollector import removals 25from debtcollector import removals
26from oslo_log import log as logging 26from oslo_log import log as logging
27 27
28from neutron._i18n import _, _LE, _LI 28from neutron._i18n import _
29from neutron.common import exceptions 29from neutron.common import exceptions
30 30
31LOG = logging.getLogger(__name__) 31LOG = logging.getLogger(__name__)
@@ -113,7 +113,7 @@ def drop_privileges(user=None, group=None):
113 if user is not None: 113 if user is not None:
114 setuid(user) 114 setuid(user)
115 115
116 LOG.info(_LI("Process runs with uid/gid: %(uid)s/%(gid)s"), 116 LOG.info("Process runs with uid/gid: %(uid)s/%(gid)s",
117 {'uid': os.getuid(), 'gid': os.getgid()}) 117 {'uid': os.getuid(), 'gid': os.getgid()})
118 118
119 119
@@ -126,7 +126,7 @@ class Pidfile(object):
126 self.fd = os.open(pidfile, os.O_CREAT | os.O_RDWR) 126 self.fd = os.open(pidfile, os.O_CREAT | os.O_RDWR)
127 fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB) 127 fcntl.flock(self.fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
128 except IOError: 128 except IOError:
129 LOG.exception(_LE("Error while handling pidfile: %s"), pidfile) 129 LOG.exception("Error while handling pidfile: %s", pidfile)
130 sys.exit(1) 130 sys.exit(1)
131 131
132 def __str__(self): 132 def __str__(self):
@@ -191,7 +191,7 @@ class Daemon(object):
191 if pid > 0: 191 if pid > 0:
192 os._exit(0) 192 os._exit(0)
193 except OSError: 193 except OSError:
194 LOG.exception(_LE('Fork failed')) 194 LOG.exception('Fork failed')
195 sys.exit(1) 195 sys.exit(1)
196 196
197 def daemonize(self): 197 def daemonize(self):
@@ -244,8 +244,8 @@ class Daemon(object):
244 244
245 if self.pidfile is not None and self.pidfile.is_running(): 245 if self.pidfile is not None and self.pidfile.is_running():
246 self.pidfile.unlock() 246 self.pidfile.unlock()
247 LOG.error(_LE('Pidfile %s already exist. Daemon already ' 247 LOG.error('Pidfile %s already exist. Daemon already '
248 'running?'), self.pidfile) 248 'running?', self.pidfile)
249 sys.exit(1) 249 sys.exit(1)
250 250
251 # Start the daemon 251 # Start the daemon
diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py
index 38b3474..0229a8e 100644
--- a/neutron/agent/linux/dhcp.py
+++ b/neutron/agent/linux/dhcp.py
@@ -32,7 +32,7 @@ from oslo_utils import fileutils
32from oslo_utils import uuidutils 32from oslo_utils import uuidutils
33import six 33import six
34 34
35from neutron._i18n import _, _LI, _LW, _LE 35from neutron._i18n import _
36from neutron.agent.common import utils as agent_common_utils 36from neutron.agent.common import utils as agent_common_utils
37from neutron.agent.linux import external_process 37from neutron.agent.linux import external_process
38from neutron.agent.linux import ip_lib 38from neutron.agent.linux import ip_lib
@@ -238,7 +238,7 @@ class DhcpLocalProcess(DhcpBase):
238 try: 238 try:
239 self.device_manager.destroy(self.network, self.interface_name) 239 self.device_manager.destroy(self.network, self.interface_name)
240 except RuntimeError: 240 except RuntimeError:
241 LOG.warning(_LW('Failed trying to delete interface: %s'), 241 LOG.warning('Failed trying to delete interface: %s',
242 self.interface_name) 242 self.interface_name)
243 243
244 ns_ip = ip_lib.IPWrapper(namespace=self.network.namespace) 244 ns_ip = ip_lib.IPWrapper(namespace=self.network.namespace)
@@ -248,7 +248,7 @@ class DhcpLocalProcess(DhcpBase):
248 try: 248 try:
249 ns_ip.netns.delete(self.network.namespace) 249 ns_ip.netns.delete(self.network.namespace)
250 except RuntimeError: 250 except RuntimeError:
251 LOG.warning(_LW('Failed trying to delete namespace: %s'), 251 LOG.warning('Failed trying to delete namespace: %s',
252 self.network.namespace) 252 self.network.namespace)
253 253
254 def _get_value_from_conf_file(self, kind, converter=None): 254 def _get_value_from_conf_file(self, kind, converter=None):
@@ -421,8 +421,7 @@ class Dnsmasq(DhcpLocalProcess):
421 if not os.path.exists(log_dir): 421 if not os.path.exists(log_dir):
422 os.makedirs(log_dir) 422 os.makedirs(log_dir)
423 except OSError: 423 except OSError:
424 LOG.error(_LE('Error while create dnsmasq log dir: %s'), 424 LOG.error('Error while create dnsmasq log dir: %s', log_dir)
425 log_dir)
426 else: 425 else:
427 log_filename = os.path.join(log_dir, 'dhcp_dns_log') 426 log_filename = os.path.join(log_dir, 'dhcp_dns_log')
428 cmd.append('--log-queries') 427 cmd.append('--log-queries')
@@ -460,8 +459,8 @@ class Dnsmasq(DhcpLocalProcess):
460 if self._IS_DHCP_RELEASE6_SUPPORTED is None: 459 if self._IS_DHCP_RELEASE6_SUPPORTED is None:
461 self._IS_DHCP_RELEASE6_SUPPORTED = checks.dhcp_release6_supported() 460 self._IS_DHCP_RELEASE6_SUPPORTED = checks.dhcp_release6_supported()
462 if not self._IS_DHCP_RELEASE6_SUPPORTED: 461 if not self._IS_DHCP_RELEASE6_SUPPORTED:
463 LOG.warning(_LW("dhcp_release6 is not present on this system, " 462 LOG.warning("dhcp_release6 is not present on this system, "
464 "will not call it again.")) 463 "will not call it again.")
465 return self._IS_DHCP_RELEASE6_SUPPORTED 464 return self._IS_DHCP_RELEASE6_SUPPORTED
466 465
467 def _release_lease(self, mac_address, ip, client_id=None, 466 def _release_lease(self, mac_address, ip, client_id=None,
@@ -483,8 +482,8 @@ class Dnsmasq(DhcpLocalProcess):
483 except RuntimeError as e: 482 except RuntimeError as e:
484 # when failed to release single lease there's 483 # when failed to release single lease there's
485 # no need to propagate error further 484 # no need to propagate error further
486 LOG.warning(_LW('DHCP release failed for %(cmd)s. ' 485 LOG.warning('DHCP release failed for %(cmd)s. '
487 'Reason: %(e)s'), {'cmd': cmd, 'e': e}) 486 'Reason: %(e)s', {'cmd': cmd, 'e': e})
488 487
489 def _output_config_files(self): 488 def _output_config_files(self):
490 self._output_hosts_file() 489 self._output_hosts_file()
@@ -798,9 +797,9 @@ class Dnsmasq(DhcpLocalProcess):
798 server_id = l.strip().split()[1] 797 server_id = l.strip().split()[1]
799 continue 798 continue
800 else: 799 else:
801 LOG.warning(_LW('Multiple DUID entries in %s ' 800 LOG.warning('Multiple DUID entries in %s '
802 'lease file, dnsmasq is possibly ' 801 'lease file, dnsmasq is possibly '
803 'not functioning properly'), 802 'not functioning properly',
804 filename) 803 filename)
805 continue 804 continue
806 parts = l.strip().split() 805 parts = l.strip().split()
@@ -969,9 +968,9 @@ class Dnsmasq(DhcpLocalProcess):
969 self._format_option(opt_ip_version, port.id, 968 self._format_option(opt_ip_version, port.id,
970 opt.opt_name, opt.opt_value)) 969 opt.opt_name, opt.opt_value))
971 else: 970 else:
972 LOG.info(_LI("Cannot apply dhcp option %(opt)s " 971 LOG.info("Cannot apply dhcp option %(opt)s "
973 "because it's ip_version %(version)d " 972 "because it's ip_version %(version)d "
974 "is not in port's address IP versions"), 973 "is not in port's address IP versions",
975 {'opt': opt.opt_name, 974 {'opt': opt.opt_name,
976 'version': opt_ip_version}) 975 'version': opt_ip_version})
977 976
@@ -1269,8 +1268,8 @@ class DeviceManager(object):
1269 'device_id': device_id}}) 1268 'device_id': device_id}})
1270 except oslo_messaging.RemoteError as e: 1269 except oslo_messaging.RemoteError as e:
1271 if e.exc_type == 'DhcpPortInUse': 1270 if e.exc_type == 'DhcpPortInUse':
1272 LOG.info(_LI("Skipping DHCP port %s as it is " 1271 LOG.info("Skipping DHCP port %s as it is "
1273 "already in use"), port.id) 1272 "already in use", port.id)
1274 continue 1273 continue
1275 raise 1274 raise
1276 if port: 1275 if port:
@@ -1374,8 +1373,8 @@ class DeviceManager(object):
1374 try: 1373 try:
1375 self.unplug(d.name, network) 1374 self.unplug(d.name, network)
1376 except Exception: 1375 except Exception:
1377 LOG.exception(_LE("Exception during stale " 1376 LOG.exception("Exception during stale "
1378 "dhcp device cleanup")) 1377 "dhcp device cleanup")
1379 1378
1380 def plug(self, network, port, interface_name): 1379 def plug(self, network, port, interface_name):
1381 """Plug device settings for the network's DHCP on this host.""" 1380 """Plug device settings for the network's DHCP on this host."""
@@ -1424,8 +1423,8 @@ class DeviceManager(object):
1424 self.plug(network, port, interface_name) 1423 self.plug(network, port, interface_name)
1425 except Exception: 1424 except Exception:
1426 with excutils.save_and_reraise_exception(): 1425 with excutils.save_and_reraise_exception():
1427 LOG.exception(_LE('Unable to plug DHCP port for ' 1426 LOG.exception('Unable to plug DHCP port for '
1428 'network %s. Releasing port.'), 1427 'network %s. Releasing port.',
1429 network.id) 1428 network.id)
1430 self.plugin.release_dhcp_port(network.id, port.device_id) 1429 self.plugin.release_dhcp_port(network.id, port.device_id)
1431 1430
diff --git a/neutron/agent/linux/external_process.py b/neutron/agent/linux/external_process.py
index 0855ddf..bd32fca 100644
--- a/neutron/agent/linux/external_process.py
+++ b/neutron/agent/linux/external_process.py
@@ -24,7 +24,7 @@ from oslo_utils import fileutils
24import psutil 24import psutil
25import six 25import six
26 26
27from neutron._i18n import _, _LW, _LE 27from neutron._i18n import _
28from neutron.agent.linux import ip_lib 28from neutron.agent.linux import ip_lib
29from neutron.agent.linux import utils 29from neutron.agent.linux import utils
30 30
@@ -237,9 +237,9 @@ class ProcessMonitor(object):
237 pm = self._monitored_processes.get(service_id) 237 pm = self._monitored_processes.get(service_id)
238 238
239 if pm and not pm.active: 239 if pm and not pm.active:
240 LOG.error(_LE("%(service)s for %(resource_type)s " 240 LOG.error("%(service)s for %(resource_type)s "
241 "with uuid %(uuid)s not found. " 241 "with uuid %(uuid)s not found. "
242 "The process should not have died"), 242 "The process should not have died",
243 {'service': service_id.service, 243 {'service': service_id.service,
244 'resource_type': self._resource_type, 244 'resource_type': self._resource_type,
245 'uuid': service_id.uuid}) 245 'uuid': service_id.uuid})
@@ -257,14 +257,14 @@ class ProcessMonitor(object):
257 action_function(service_id) 257 action_function(service_id)
258 258
259 def _respawn_action(self, service_id): 259 def _respawn_action(self, service_id):
260 LOG.warning(_LW("Respawning %(service)s for uuid %(uuid)s"), 260 LOG.warning("Respawning %(service)s for uuid %(uuid)s",
261 {'service': service_id.service, 261 {'service': service_id.service,
262 'uuid': service_id.uuid}) 262 'uuid': service_id.uuid})
263 self._monitored_processes[service_id].enable() 263 self._monitored_processes[service_id].enable()
264 264
265 def _exit_action(self, service_id): 265 def _exit_action(self, service_id):
266 LOG.error(_LE("Exiting agent as programmed in check_child_processes_" 266 LOG.error("Exiting agent as programmed in check_child_processes_"
267 "actions")) 267 "actions")
268 self._exit_handler(service_id.uuid, service_id.service) 268 self._exit_handler(service_id.uuid, service_id.service)
269 269
270 def _exit_handler(self, uuid, service): 270 def _exit_handler(self, uuid, service):
@@ -274,7 +274,7 @@ class ProcessMonitor(object):
274 check_child_processes_actions, and one of our external processes die 274 check_child_processes_actions, and one of our external processes die
275 unexpectedly. 275 unexpectedly.
276 """ 276 """
277 LOG.error(_LE("Exiting agent because of a malfunction with the " 277 LOG.error("Exiting agent because of a malfunction with the "
278 "%(service)s process identified by uuid %(uuid)s"), 278 "%(service)s process identified by uuid %(uuid)s",
279 {'service': service, 'uuid': uuid}) 279 {'service': service, 'uuid': uuid})
280 raise SystemExit(1) 280 raise SystemExit(1)
diff --git a/neutron/agent/linux/interface.py b/neutron/agent/linux/interface.py
index bf4d51e..88d6e67 100644
--- a/neutron/agent/linux/interface.py
+++ b/neutron/agent/linux/interface.py
@@ -22,7 +22,7 @@ from oslo_config import cfg
22from oslo_log import log as logging 22from oslo_log import log as logging
23import six 23import six
24 24
25from neutron._i18n import _, _LE, _LI, _LW 25from neutron._i18n import _
26from neutron.agent.common import ovs_lib 26from neutron.agent.common import ovs_lib
27from neutron.agent.linux import ip_lib 27from neutron.agent.linux import ip_lib
28from neutron.agent.linux import utils 28from neutron.agent.linux import utils
@@ -265,12 +265,12 @@ class LinuxInterfaceDriver(object):
265 self.plug_new(network_id, port_id, device_name, mac_address, 265 self.plug_new(network_id, port_id, device_name, mac_address,
266 bridge, namespace, prefix, mtu) 266 bridge, namespace, prefix, mtu)
267 else: 267 else:
268 LOG.info(_LI("Device %s already exists"), device_name) 268 LOG.info("Device %s already exists", device_name)
269 if mtu: 269 if mtu:
270 self.set_mtu( 270 self.set_mtu(
271 device_name, mtu, namespace=namespace, prefix=prefix) 271 device_name, mtu, namespace=namespace, prefix=prefix)
272 else: 272 else:
273 LOG.warning(_LW("No MTU configured for port %s"), port_id) 273 LOG.warning("No MTU configured for port %s", port_id)
274 274
275 @abc.abstractmethod 275 @abc.abstractmethod
276 def unplug(self, device_name, bridge=None, namespace=None, prefix=None): 276 def unplug(self, device_name, bridge=None, namespace=None, prefix=None):
@@ -296,7 +296,7 @@ class LinuxInterfaceDriver(object):
296 def set_mtu(self, device_name, mtu, namespace=None, prefix=None): 296 def set_mtu(self, device_name, mtu, namespace=None, prefix=None):
297 """Set MTU on the interface.""" 297 """Set MTU on the interface."""
298 if not self._mtu_update_warn_logged: 298 if not self._mtu_update_warn_logged:
299 LOG.warning(_LW("Interface driver cannot update MTU for ports")) 299 LOG.warning("Interface driver cannot update MTU for ports")
300 self._mtu_update_warn_logged = True 300 self._mtu_update_warn_logged = True
301 301
302 302
@@ -367,7 +367,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
367 ns_dev.link.set_address(mac_address) 367 ns_dev.link.set_address(mac_address)
368 break 368 break
369 except RuntimeError as e: 369 except RuntimeError as e:
370 LOG.warning(_LW("Got error trying to set mac, retrying: %s"), 370 LOG.warning("Got error trying to set mac, retrying: %s",
371 str(e)) 371 str(e))
372 time.sleep(1) 372 time.sleep(1)
373 else: 373 else:
@@ -386,7 +386,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
386 if mtu: 386 if mtu:
387 self.set_mtu(device_name, mtu, namespace=namespace, prefix=prefix) 387 self.set_mtu(device_name, mtu, namespace=namespace, prefix=prefix)
388 else: 388 else:
389 LOG.warning(_LW("No MTU configured for port %s"), port_id) 389 LOG.warning("No MTU configured for port %s", port_id)
390 390
391 ns_dev.link.set_up() 391 ns_dev.link.set_up()
392 if self.conf.ovs_use_veth: 392 if self.conf.ovs_use_veth:
@@ -408,7 +408,7 @@ class OVSInterfaceDriver(LinuxInterfaceDriver):
408 device.link.delete() 408 device.link.delete()
409 LOG.debug("Unplugged interface '%s'", device_name) 409 LOG.debug("Unplugged interface '%s'", device_name)
410 except RuntimeError: 410 except RuntimeError:
411 LOG.error(_LE("Failed unplugging interface '%s'"), 411 LOG.error("Failed unplugging interface '%s'",
412 device_name) 412 device_name)
413 413
414 def set_mtu(self, device_name, mtu, namespace=None, prefix=None): 414 def set_mtu(self, device_name, mtu, namespace=None, prefix=None):
@@ -458,7 +458,7 @@ class IVSInterfaceDriver(LinuxInterfaceDriver):
458 ns_dev.link.set_mtu(mtu) 458 ns_dev.link.set_mtu(mtu)
459 root_dev.link.set_mtu(mtu) 459 root_dev.link.set_mtu(mtu)
460 else: 460 else:
461 LOG.warning(_LW("No MTU configured for port %s"), port_id) 461 LOG.warning("No MTU configured for port %s", port_id)
462 462
463 if namespace: 463 if namespace:
464 namespace_obj = ip.ensure_namespace(namespace) 464 namespace_obj = ip.ensure_namespace(namespace)
@@ -477,7 +477,7 @@ class IVSInterfaceDriver(LinuxInterfaceDriver):
477 device.link.delete() 477 device.link.delete()
478 LOG.debug("Unplugged interface '%s'", device_name) 478 LOG.debug("Unplugged interface '%s'", device_name)
479 except RuntimeError: 479 except RuntimeError:
480 LOG.error(_LE("Failed unplugging interface '%s'"), 480 LOG.error("Failed unplugging interface '%s'",
481 device_name) 481 device_name)
482 482
483 483
@@ -503,7 +503,7 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver):
503 if mtu: 503 if mtu:
504 self.set_mtu(device_name, mtu, namespace=namespace, prefix=prefix) 504 self.set_mtu(device_name, mtu, namespace=namespace, prefix=prefix)
505 else: 505 else:
506 LOG.warning(_LW("No MTU configured for port %s"), port_id) 506 LOG.warning("No MTU configured for port %s", port_id)
507 507
508 root_veth.link.set_up() 508 root_veth.link.set_up()
509 ns_veth.link.set_up() 509 ns_veth.link.set_up()
@@ -515,7 +515,7 @@ class BridgeInterfaceDriver(LinuxInterfaceDriver):
515 device.link.delete() 515 device.link.delete()
516 LOG.debug("Unplugged interface '%s'", device_name) 516 LOG.debug("Unplugged interface '%s'", device_name)
517 except RuntimeError: 517 except RuntimeError:
518 LOG.error(_LE("Failed unplugging interface '%s'"), 518 LOG.error("Failed unplugging interface '%s'",
519 device_name) 519 device_name)
520 520
521 def set_mtu(self, device_name, mtu, namespace=None, prefix=None): 521 def set_mtu(self, device_name, mtu, namespace=None, prefix=None):
diff --git a/neutron/agent/linux/ip_conntrack.py b/neutron/agent/linux/ip_conntrack.py
index 33c08678..56651d7 100644
--- a/neutron/agent/linux/ip_conntrack.py
+++ b/neutron/agent/linux/ip_conntrack.py
@@ -17,7 +17,6 @@ import netaddr
17from oslo_concurrency import lockutils 17from oslo_concurrency import lockutils
18from oslo_log import log as logging 18from oslo_log import log as logging
19 19
20from neutron._i18n import _LE
21from neutron.agent.linux import utils as linux_utils 20from neutron.agent.linux import utils as linux_utils
22from neutron.common import constants as n_const 21from neutron.common import constants as n_const
23from neutron.common import exceptions as n_exc 22from neutron.common import exceptions as n_exc
@@ -107,8 +106,7 @@ class IpConntrackManager(object):
107 check_exit_code=True, 106 check_exit_code=True,
108 extra_ok_codes=[1]) 107 extra_ok_codes=[1])
109 except RuntimeError: 108 except RuntimeError:
110 LOG.exception( 109 LOG.exception("Failed execute conntrack command %s", cmd)
111 _LE("Failed execute conntrack command %s"), cmd)
112 110
113 def delete_conntrack_state_by_rule(self, device_info_list, rule): 111 def delete_conntrack_state_by_rule(self, device_info_list, rule):
114 self._delete_conntrack_state(device_info_list, rule) 112 self._delete_conntrack_state(device_info_list, rule)
diff --git a/neutron/agent/linux/ip_lib.py b/neutron/agent/linux/ip_lib.py
index a7fb927..18bb6a1 100644
--- a/neutron/agent/linux/ip_lib.py
+++ b/neutron/agent/linux/ip_lib.py
@@ -27,7 +27,7 @@ from oslo_log import log as logging
27from oslo_utils import excutils 27from oslo_utils import excutils
28import six 28import six
29 29
30from neutron._i18n import _, _LE, _LW 30from neutron._i18n import _
31from neutron.agent.common import utils 31from neutron.agent.common import utils
32from neutron.common import exceptions as n_exc 32from neutron.common import exceptions as n_exc
33from neutron.common import utils as common_utils 33from neutron.common import utils as common_utils
@@ -326,8 +326,8 @@ class IPDevice(SubProcessBase):
326 extra_ok_codes=[1]) 326 extra_ok_codes=[1])
327 327
328 except RuntimeError: 328 except RuntimeError:
329 LOG.exception(_LE("Failed deleting ingress connection state of" 329 LOG.exception("Failed deleting ingress connection state of"
330 " floatingip %s"), ip_str) 330 " floatingip %s", ip_str)
331 331
332 # Delete conntrack state for egress traffic 332 # Delete conntrack state for egress traffic
333 try: 333 try:
@@ -335,8 +335,8 @@ class IPDevice(SubProcessBase):
335 check_exit_code=True, 335 check_exit_code=True,
336 extra_ok_codes=[1]) 336 extra_ok_codes=[1])
337 except RuntimeError: 337 except RuntimeError:
338 LOG.exception(_LE("Failed deleting egress connection state of" 338 LOG.exception("Failed deleting egress connection state of"
339 " floatingip %s"), ip_str) 339 " floatingip %s", ip_str)
340 340
341 def disable_ipv6(self): 341 def disable_ipv6(self):
342 sysctl_name = re.sub(r'\.', '/', self.name) 342 sysctl_name = re.sub(r'\.', '/', self.name)
@@ -1100,8 +1100,8 @@ def _arping(ns_name, iface_name, address, count, log_exception):
1100 'ns': ns_name, 1100 'ns': ns_name,
1101 'err': exc}) 1101 'err': exc})
1102 if not exists: 1102 if not exists:
1103 LOG.warning(_LW("Interface %s might have been deleted " 1103 LOG.warning("Interface %s might have been deleted "
1104 "concurrently"), iface_name) 1104 "concurrently", iface_name)
1105 return 1105 return
1106 1106
1107 1107
@@ -1160,7 +1160,7 @@ def sysctl(cmd, namespace=None, log_fail_as_error=True):
1160 log_fail_as_error=log_fail_as_error) 1160 log_fail_as_error=log_fail_as_error)
1161 except RuntimeError as rte: 1161 except RuntimeError as rte:
1162 LOG.warning( 1162 LOG.warning(
1163 _LW("Setting %(cmd)s in namespace %(ns)s failed: %(err)s."), 1163 "Setting %(cmd)s in namespace %(ns)s failed: %(err)s.",
1164 {'cmd': cmd, 1164 {'cmd': cmd,
1165 'ns': namespace, 1165 'ns': namespace,
1166 'err': rte}) 1166 'err': rte})
@@ -1207,9 +1207,9 @@ def set_ip_nonlocal_bind_for_namespace(namespace):
1207 log_fail_as_error=False) 1207 log_fail_as_error=False)
1208 if failed: 1208 if failed:
1209 LOG.warning( 1209 LOG.warning(
1210 _LW("%s will not be set to 0 in the root namespace in order to " 1210 "%s will not be set to 0 in the root namespace in order to "
1211 "not break DVR, which requires this value be set to 1. This " 1211 "not break DVR, which requires this value be set to 1. This "
1212 "may introduce a race between moving a floating IP to a " 1212 "may introduce a race between moving a floating IP to a "
1213 "different network node, and the peer side getting a " 1213 "different network node, and the peer side getting a "
1214 "populated ARP cache for a given floating IP address."), 1214 "populated ARP cache for a given floating IP address.",
1215 IP_NONLOCAL_BIND) 1215 IP_NONLOCAL_BIND)
diff --git a/neutron/agent/linux/ip_link_support.py b/neutron/agent/linux/ip_link_support.py
index 225a39b..46d40ed 100644
--- a/neutron/agent/linux/ip_link_support.py
+++ b/neutron/agent/linux/ip_link_support.py
@@ -18,7 +18,7 @@ import re
18from neutron_lib import exceptions as n_exc 18from neutron_lib import exceptions as n_exc
19from oslo_log import log as logging 19from oslo_log import log as logging
20 20
21from neutron._i18n import _, _LE 21from neutron._i18n import _
22from neutron.agent.linux import utils 22from neutron.agent.linux import utils
23 23
24 24
@@ -103,6 +103,6 @@ class IpLinkSupport(object):
103 return_stderr=True, 103 return_stderr=True,
104 log_fail_as_error=False) 104 log_fail_as_error=False)
105 except Exception as e: 105 except Exception as e:
106 LOG.exception(_LE("Failed executing ip command")) 106 LOG.exception("Failed executing ip command")
107 raise UnsupportedIpLinkCommand(reason=e) 107 raise UnsupportedIpLinkCommand(reason=e)
108 return _stdout or _stderr 108 return _stdout or _stderr
diff --git a/neutron/agent/linux/ip_monitor.py b/neutron/agent/linux/ip_monitor.py
index 4e36c81..33db43c 100644
--- a/neutron/agent/linux/ip_monitor.py
+++ b/neutron/agent/linux/ip_monitor.py
@@ -16,7 +16,6 @@
16from oslo_log import log as logging 16from oslo_log import log as logging
17from oslo_utils import excutils 17from oslo_utils import excutils
18 18
19from neutron._i18n import _LE
20from neutron.agent.linux import async_process 19from neutron.agent.linux import async_process
21from neutron.agent.linux import ip_lib 20from neutron.agent.linux import ip_lib
22 21
@@ -41,7 +40,7 @@ class IPMonitorEvent(object):
41 first_word = route[0] 40 first_word = route[0]
42 except IndexError: 41 except IndexError:
43 with excutils.save_and_reraise_exception(): 42 with excutils.save_and_reraise_exception():
44 LOG.error(_LE('Unable to parse route "%s"'), line) 43 LOG.error('Unable to parse route "%s"', line)
45 44
46 added = (first_word != 'Deleted') 45 added = (first_word != 'Deleted')
47 if not added: 46 if not added:
@@ -52,7 +51,7 @@ class IPMonitorEvent(object):
52 cidr = route[3] 51 cidr = route[3]
53 except IndexError: 52 except IndexError:
54 with excutils.save_and_reraise_exception(): 53 with excutils.save_and_reraise_exception():
55 LOG.error(_LE('Unable to parse route "%s"'), line) 54 LOG.error('Unable to parse route "%s"', line)
56 55
57 return cls(line, added, interface, cidr) 56 return cls(line, added, interface, cidr)
58 57
diff --git a/neutron/agent/linux/iptables_firewall.py b/neutron/agent/linux/iptables_firewall.py
index 807c023..bf2a8b8 100644
--- a/neutron/agent/linux/iptables_firewall.py
+++ b/neutron/agent/linux/iptables_firewall.py
@@ -21,7 +21,6 @@ from oslo_config import cfg
21from oslo_log import log as logging 21from oslo_log import log as logging
22from oslo_utils import netutils 22from oslo_utils import netutils
23 23
24from neutron._i18n import _LI
25from neutron.agent import firewall 24from neutron.agent import firewall
26from neutron.agent.linux import ip_conntrack 25from neutron.agent.linux import ip_conntrack
27from neutron.agent.linux import ipset_manager 26from neutron.agent.linux import ipset_manager
@@ -160,8 +159,8 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
160 def update_port_filter(self, port): 159 def update_port_filter(self, port):
161 LOG.debug("Updating device (%s) filter", port['device']) 160 LOG.debug("Updating device (%s) filter", port['device'])
162 if port['device'] not in self.ports: 161 if port['device'] not in self.ports:
163 LOG.info(_LI('Attempted to update port filter which is not ' 162 LOG.info('Attempted to update port filter which is not '
164 'filtered %s'), port['device']) 163 'filtered %s', port['device'])
165 return 164 return
166 self._remove_chains() 165 self._remove_chains()
167 self._set_ports(port) 166 self._set_ports(port)
@@ -171,8 +170,8 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
171 def remove_port_filter(self, port): 170 def remove_port_filter(self, port):
172 LOG.debug("Removing device (%s) filter", port['device']) 171 LOG.debug("Removing device (%s) filter", port['device'])
173 if port['device'] not in self.ports: 172 if port['device'] not in self.ports:
174 LOG.info(_LI('Attempted to remove port filter which is not ' 173 LOG.info('Attempted to remove port filter which is not '
175 'filtered %r'), port) 174 'filtered %r', port)
176 return 175 return
177 self._remove_chains() 176 self._remove_chains()
178 self._remove_conntrack_entries_from_port_deleted(port) 177 self._remove_conntrack_entries_from_port_deleted(port)
diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py
index 1162e78..e07ca49 100644
--- a/neutron/agent/linux/iptables_manager.py
+++ b/neutron/agent/linux/iptables_manager.py
@@ -30,7 +30,7 @@ from oslo_config import cfg
30from oslo_log import log as logging 30from oslo_log import log as logging
31from oslo_utils import excutils 31from oslo_utils import excutils
32 32
33from neutron._i18n import _, _LE, _LW 33from neutron._i18n import _
34from neutron.agent.linux import ip_lib 34from neutron.agent.linux import ip_lib
35from neutron.agent.linux import iptables_comments as ic 35from neutron.agent.linux import iptables_comments as ic
36from neutron.agent.linux import utils as linux_utils 36from neutron.agent.linux import utils as linux_utils
@@ -247,8 +247,8 @@ class IptablesTable(object):
247 top, self.wrap_name, 247 top, self.wrap_name,
248 comment=comment))) 248 comment=comment)))
249 except ValueError: 249 except ValueError:
250 LOG.warning(_LW('Tried to remove rule that was not there:' 250 LOG.warning('Tried to remove rule that was not there:'
251 ' %(chain)r %(rule)r %(wrap)r %(top)r'), 251 ' %(chain)r %(rule)r %(wrap)r %(top)r',
252 {'chain': chain, 'rule': rule, 252 {'chain': chain, 'rule': rule,
253 'top': top, 'wrap': wrap}) 253 'top': top, 'wrap': wrap})
254 254
@@ -533,8 +533,8 @@ class IptablesManager(object):
533 commands[log_start:log_end], 533 commands[log_start:log_end],
534 log_start + 1) 534 log_start + 1)
535 ) 535 )
536 LOG.error(_LE("IPTablesManager.apply failed to apply the " 536 LOG.error("IPTablesManager.apply failed to apply the "
537 "following set of iptables rules:\n%s"), 537 "following set of iptables rules:\n%s",
538 '\n'.join(log_lines)) 538 '\n'.join(log_lines))
539 LOG.debug("IPTablesManager.apply completed with success. %d iptables " 539 LOG.debug("IPTablesManager.apply completed with success. %d iptables "
540 "commands were issued", len(all_commands)) 540 "commands were issued", len(all_commands))
@@ -636,9 +636,9 @@ class IptablesManager(object):
636 def _weed_out_duplicates(line): 636 def _weed_out_duplicates(line):
637 if line in seen_lines: 637 if line in seen_lines:
638 thing = 'chain' if line.startswith(':') else 'rule' 638 thing = 'chain' if line.startswith(':') else 'rule'
639 LOG.warning(_LW("Duplicate iptables %(thing)s detected. This " 639 LOG.warning("Duplicate iptables %(thing)s detected. This "
640 "may indicate a bug in the iptables " 640 "may indicate a bug in the iptables "
641 "%(thing)s generation code. Line: %(line)s"), 641 "%(thing)s generation code. Line: %(line)s",
642 {'thing': thing, 'line': line}) 642 {'thing': thing, 'line': line})
643 return False 643 return False
644 seen_lines.add(line) 644 seen_lines.add(line)
@@ -675,8 +675,8 @@ class IptablesManager(object):
675 """Return the sum of the traffic counters of all rules of a chain.""" 675 """Return the sum of the traffic counters of all rules of a chain."""
676 cmd_tables = self._get_traffic_counters_cmd_tables(chain, wrap) 676 cmd_tables = self._get_traffic_counters_cmd_tables(chain, wrap)
677 if not cmd_tables: 677 if not cmd_tables:
678 LOG.warning(_LW('Attempted to get traffic counters of chain %s ' 678 LOG.warning('Attempted to get traffic counters of chain %s '
679 'which does not exist'), chain) 679 'which does not exist', chain)
680 return 680 return
681 681
682 name = get_chain_name(chain, wrap) 682 name = get_chain_name(chain, wrap)
diff --git a/neutron/agent/linux/keepalived.py b/neutron/agent/linux/keepalived.py
index c533291..a0230eb 100644
--- a/neutron/agent/linux/keepalived.py
+++ b/neutron/agent/linux/keepalived.py
@@ -23,7 +23,7 @@ from oslo_config import cfg
23from oslo_log import log as logging 23from oslo_log import log as logging
24from oslo_utils import fileutils 24from oslo_utils import fileutils
25 25
26from neutron._i18n import _, _LE 26from neutron._i18n import _
27from neutron.agent.linux import external_process 27from neutron.agent.linux import external_process
28from neutron.common import constants 28from neutron.common import constants
29from neutron.common import utils 29from neutron.common import utils
@@ -406,8 +406,8 @@ class KeepalivedManager(object):
406 os.remove(pid_file) 406 os.remove(pid_file)
407 except OSError as e: 407 except OSError as e:
408 if e.errno != errno.ENOENT: 408 if e.errno != errno.ENOENT:
409 LOG.error(_LE("Could not delete file %s, keepalived can " 409 LOG.error("Could not delete file %s, keepalived can "
410 "refuse to start."), pid_file) 410 "refuse to start.", pid_file)
411 411
412 def get_vrrp_pid_file_name(self, base_pid_file): 412 def get_vrrp_pid_file_name(self, base_pid_file):
413 return '%s-vrrp' % base_pid_file 413 return '%s-vrrp' % base_pid_file
diff --git a/neutron/agent/linux/openvswitch_firewall/firewall.py b/neutron/agent/linux/openvswitch_firewall/firewall.py
index 413b7ae..3da5ef5 100644
--- a/neutron/agent/linux/openvswitch_firewall/firewall.py
+++ b/neutron/agent/linux/openvswitch_firewall/firewall.py
@@ -20,7 +20,6 @@ from neutron_lib import constants as lib_const
20from oslo_log import log as logging 20from oslo_log import log as logging
21from oslo_utils import netutils 21from oslo_utils import netutils
22 22
23from neutron._i18n import _LE
24from neutron.agent import firewall 23from neutron.agent import firewall
25from neutron.agent.linux.openvswitch_firewall import constants as ovsfw_consts 24from neutron.agent.linux.openvswitch_firewall import constants as ovsfw_consts
26from neutron.agent.linux.openvswitch_firewall import exceptions 25from neutron.agent.linux.openvswitch_firewall import exceptions
@@ -463,8 +462,8 @@ class OVSFirewallDriver(firewall.FirewallDriver):
463 # allow_address_pair MACs will be updated in 462 # allow_address_pair MACs will be updated in
464 # self.get_or_create_ofport(port) 463 # self.get_or_create_ofport(port)
465 if old_of_port: 464 if old_of_port:
466 LOG.error(_LE("Initializing port %s that was already " 465 LOG.error("Initializing port %s that was already "
467 "initialized."), 466 "initialized.",
468 port['device']) 467 port['device'])
469 self.delete_all_port_flows(old_of_port) 468 self.delete_all_port_flows(old_of_port)
470 of_port = self.get_or_create_ofport(port) 469 of_port = self.get_or_create_ofport(port)
diff --git a/neutron/agent/linux/ovsdb_monitor.py b/neutron/agent/linux/ovsdb_monitor.py
index 9ea878c..ed4dff5 100644
--- a/neutron/agent/linux/ovsdb_monitor.py
+++ b/neutron/agent/linux/ovsdb_monitor.py
@@ -15,7 +15,6 @@
15from oslo_log import log as logging 15from oslo_log import log as logging
16from oslo_serialization import jsonutils 16from oslo_serialization import jsonutils
17 17
18from neutron._i18n import _LE
19from neutron.agent.linux import async_process 18from neutron.agent.linux import async_process
20from neutron.agent.ovsdb import api as ovsdb 19from neutron.agent.ovsdb import api as ovsdb
21from neutron.agent.ovsdb.native import helpers 20from neutron.agent.ovsdb.native import helpers
@@ -81,7 +80,7 @@ class SimpleInterfaceMonitor(OvsdbMonitor):
81 temporary if respawn_interval is set. 80 temporary if respawn_interval is set.
82 """ 81 """
83 if not self.is_active(): 82 if not self.is_active():
84 LOG.error(_LE("Interface monitor is not active")) 83 LOG.error("Interface monitor is not active")
85 else: 84 else:
86 self.process_events() 85 self.process_events()
87 return bool(self.new_events['added'] or self.new_events['removed']) 86 return bool(self.new_events['added'] or self.new_events['removed'])
diff --git a/neutron/agent/linux/pd.py b/neutron/agent/linux/pd.py
index 2899bcb..02ef2e8 100644
--- a/neutron/agent/linux/pd.py
+++ b/neutron/agent/linux/pd.py
@@ -27,7 +27,7 @@ from oslo_utils import netutils
27import six 27import six
28from stevedore import driver 28from stevedore import driver
29 29
30from neutron._i18n import _, _LE 30from neutron._i18n import _
31from neutron.common import constants as l3_constants 31from neutron.common import constants as l3_constants
32from neutron.common import utils 32from neutron.common import utils
33 33
@@ -392,8 +392,8 @@ def update_router(resource, event, l3_agent, **kwargs):
392 updated_router = kwargs['router'] 392 updated_router = kwargs['router']
393 router = l3_agent.pd.routers.get(updated_router.router_id) 393 router = l3_agent.pd.routers.get(updated_router.router_id)
394 if not router: 394 if not router:
395 LOG.exception(_LE("Router to be updated is not in internal routers " 395 LOG.exception("Router to be updated is not in internal routers "
396 "list: %s"), updated_router.router_id) 396 "list: %s", updated_router.router_id)
397 else: 397 else:
398 router['ns_name'] = updated_router.get_gw_ns_name() 398 router['ns_name'] = updated_router.get_gw_ns_name()
399 399
diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py
index deaa60e..7dc8489 100644
--- a/neutron/agent/linux/utils.py
+++ b/neutron/agent/linux/utils.py
@@ -33,7 +33,7 @@ from oslo_utils import excutils
33from oslo_utils import fileutils 33from oslo_utils import fileutils
34from six.moves import http_client as httplib 34from six.moves import http_client as httplib
35 35
36from neutron._i18n import _, _LE 36from neutron._i18n import _
37from neutron.agent.linux import xenapi_root_helper 37from neutron.agent.linux import xenapi_root_helper
38from neutron.common import utils 38from neutron.common import utils
39from neutron.conf.agent import common as config 39from neutron.conf.agent import common as config
@@ -111,7 +111,7 @@ def execute_rootwrap_daemon(cmd, process_input, addl_env):
111 return client.execute(cmd, process_input) 111 return client.execute(cmd, process_input)
112 except Exception: 112 except Exception:
113 with excutils.save_and_reraise_exception(): 113 with excutils.save_and_reraise_exception():
114 LOG.error(_LE("Rootwrap error running command: %s"), cmd) 114 LOG.error("Rootwrap error running command: %s", cmd)
115 115
116 116
117def execute(cmd, process_input=None, addl_env=None, 117def execute(cmd, process_input=None, addl_env=None,
@@ -249,7 +249,7 @@ def get_value_from_file(filename, converter=None):
249 try: 249 try:
250 return converter(f.read()) if converter else f.read() 250 return converter(f.read()) if converter else f.read()
251 except ValueError: 251 except ValueError:
252 LOG.error(_LE('Unable to convert value in %s'), filename) 252 LOG.error('Unable to convert value in %s', filename)
253 except IOError: 253 except IOError:
254 LOG.debug('Unable to access %s', filename) 254 LOG.debug('Unable to access %s', filename)
255 255
diff --git a/neutron/agent/linux/xenapi_root_helper.py b/neutron/agent/linux/xenapi_root_helper.py
index f783208..4dacc1e 100644
--- a/neutron/agent/linux/xenapi_root_helper.py
+++ b/neutron/agent/linux/xenapi_root_helper.py
@@ -29,7 +29,6 @@ from oslo_log import log as logging
29from oslo_rootwrap import cmd as oslo_rootwrap_cmd 29from oslo_rootwrap import cmd as oslo_rootwrap_cmd
30from oslo_serialization import jsonutils 30from oslo_serialization import jsonutils
31 31
32from neutron._i18n import _LE
33from neutron.conf.agent import xenapi_conf 32from neutron.conf.agent import xenapi_conf
34 33
35 34
@@ -88,6 +87,6 @@ class XenAPIClient(object):
88 err = result['err'] 87 err = result['err']
89 return returncode, out, err 88 return returncode, out, err
90 except XenAPI.Failure as failure: 89 except XenAPI.Failure as failure:
91 LOG.exception(_LE('Failed to execute command: %s'), cmd) 90 LOG.exception('Failed to execute command: %s', cmd)
92 returncode = self._get_return_code(failure.details) 91 returncode = self._get_return_code(failure.details)
93 return returncode, out, err 92 return returncode, out, err
diff --git a/neutron/agent/metadata/agent.py b/neutron/agent/metadata/agent.py
index f849945c..d3cdb93 100644
--- a/neutron/agent/metadata/agent.py
+++ b/neutron/agent/metadata/agent.py
@@ -27,7 +27,7 @@ import six
27import six.moves.urllib.parse as urlparse 27import six.moves.urllib.parse as urlparse
28import webob 28import webob
29 29
30from neutron._i18n import _, _LE, _LW 30from neutron._i18n import _
31from neutron.agent.linux import utils as agent_utils 31from neutron.agent.linux import utils as agent_utils
32from neutron.agent import rpc as agent_rpc 32from neutron.agent import rpc as agent_rpc
33from neutron.common import cache_utils as cache 33from neutron.common import cache_utils as cache
@@ -92,7 +92,7 @@ class MetadataProxyHandler(object):
92 return webob.exc.HTTPNotFound() 92 return webob.exc.HTTPNotFound()
93 93
94 except Exception: 94 except Exception:
95 LOG.exception(_LE("Unexpected error.")) 95 LOG.exception("Unexpected error.")
96 msg = _('An unknown error has occurred. ' 96 msg = _('An unknown error has occurred. '
97 'Please try your request again.') 97 'Please try your request again.')
98 explanation = six.text_type(msg) 98 explanation = six.text_type(msg)
@@ -198,10 +198,10 @@ class MetadataProxyHandler(object):
198 LOG.debug(str(resp)) 198 LOG.debug(str(resp))
199 return req.response 199 return req.response
200 elif resp.status == 403: 200 elif resp.status == 403:
201 LOG.warning(_LW( 201 LOG.warning(
202 'The remote metadata server responded with Forbidden. This ' 202 'The remote metadata server responded with Forbidden. This '
203 'response usually occurs when shared secrets do not match.' 203 'response usually occurs when shared secrets do not match.'
204 )) 204 )
205 return webob.exc.HTTPForbidden() 205 return webob.exc.HTTPForbidden()
206 elif resp.status == 400: 206 elif resp.status == 400:
207 return webob.exc.HTTPBadRequest() 207 return webob.exc.HTTPBadRequest()
@@ -262,12 +262,12 @@ class UnixDomainMetadataProxy(object):
262 use_call=self.agent_state.get('start_flag')) 262 use_call=self.agent_state.get('start_flag'))
263 except AttributeError: 263 except AttributeError:
264 # This means the server does not support report_state 264 # This means the server does not support report_state
265 LOG.warning(_LW('Neutron server does not support state report.' 265 LOG.warning('Neutron server does not support state report.'
266 ' State report for this agent will be disabled.')) 266 ' State report for this agent will be disabled.')
267 self.heartbeat.stop() 267 self.heartbeat.stop()
268 return 268 return
269 except Exception: 269 except Exception:
270 LOG.exception(_LE("Failed reporting state!")) 270 LOG.exception("Failed reporting state!")
271 return 271 return
272 self.agent_state.pop('start_flag', None) 272 self.agent_state.pop('start_flag', None)
273 273
diff --git a/neutron/agent/ovsdb/impl_vsctl.py b/neutron/agent/ovsdb/impl_vsctl.py
index 24dab28..4440554 100644
--- a/neutron/agent/ovsdb/impl_vsctl.py
+++ b/neutron/agent/ovsdb/impl_vsctl.py
@@ -22,7 +22,6 @@ from oslo_utils import excutils
22from oslo_utils import uuidutils 22from oslo_utils import uuidutils
23import six 23import six
24 24
25from neutron._i18n import _LE
26from neutron.agent.common import utils 25from neutron.agent.common import utils
27from neutron.agent.ovsdb import api as ovsdb 26from neutron.agent.ovsdb import api as ovsdb
28 27
@@ -70,8 +69,8 @@ class Transaction(ovsdb.Transaction):
70 except Exception as e: 69 except Exception as e:
71 with excutils.save_and_reraise_exception() as ctxt: 70 with excutils.save_and_reraise_exception() as ctxt:
72 if self.log_errors: 71 if self.log_errors:
73 LOG.error(_LE("Unable to execute %(cmd)s. " 72 LOG.error("Unable to execute %(cmd)s. "
74 "Exception: %(exception)s"), 73 "Exception: %(exception)s",
75 {'cmd': full_args, 'exception': e}) 74 {'cmd': full_args, 'exception': e})
76 if not self.check_error: 75 if not self.check_error:
77 ctxt.reraise = False 76 ctxt.reraise = False
@@ -130,8 +129,8 @@ class DbCommand(BaseCommand):
130 # This shouldn't happen, but if it does and we check_errors 129 # This shouldn't happen, but if it does and we check_errors
131 # log and raise. 130 # log and raise.
132 with excutils.save_and_reraise_exception(): 131 with excutils.save_and_reraise_exception():
133 LOG.error(_LE("Could not parse: %(raw_result)s. " 132 LOG.error("Could not parse: %(raw_result)s. "
134 "Exception: %(exception)s"), 133 "Exception: %(exception)s",
135 {'raw_result': raw_result, 'exception': e}) 134 {'raw_result': raw_result, 'exception': e})
136 135
137 headings = json['headings'] 136 headings = json['headings']
diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py
index 21df1dd..48da746 100644
--- a/neutron/agent/securitygroups_rpc.py
+++ b/neutron/agent/securitygroups_rpc.py
@@ -21,7 +21,6 @@ from oslo_config import cfg
21from oslo_log import log as logging 21from oslo_log import log as logging
22import oslo_messaging 22import oslo_messaging
23 23
24from neutron._i18n import _LI, _LW
25from neutron.agent import firewall 24from neutron.agent import firewall
26from neutron.api.rpc.handlers import securitygroups_rpc 25from neutron.api.rpc.handlers import securitygroups_rpc
27from neutron.conf.agent import securitygroups_rpc as sc_cfg 26from neutron.conf.agent import securitygroups_rpc as sc_cfg
@@ -44,9 +43,9 @@ def _disable_extension(extension, aliases):
44 43
45def disable_security_group_extension_by_config(aliases): 44def disable_security_group_extension_by_config(aliases):
46 if not is_firewall_enabled(): 45 if not is_firewall_enabled():
47 LOG.info(_LI('Disabled security-group extension.')) 46 LOG.info('Disabled security-group extension.')
48 _disable_extension('security-group', aliases) 47 _disable_extension('security-group', aliases)
49 LOG.info(_LI('Disabled allowed-address-pairs extension.')) 48 LOG.info('Disabled allowed-address-pairs extension.')
50 _disable_extension('allowed-address-pairs', aliases) 49 _disable_extension('allowed-address-pairs', aliases)
51 50
52 51
@@ -91,10 +90,10 @@ class SecurityGroupAgentRpc(object):
91 self.plugin_rpc.security_group_info_for_devices( 90 self.plugin_rpc.security_group_info_for_devices(
92 self.context, devices=[]) 91 self.context, devices=[])
93 except oslo_messaging.UnsupportedVersion: 92 except oslo_messaging.UnsupportedVersion:
94 LOG.warning(_LW('security_group_info_for_devices rpc call not ' 93 LOG.warning('security_group_info_for_devices rpc call not '
95 'supported by the server, falling back to old ' 94 'supported by the server, falling back to old '
96 'security_group_rules_for_devices which scales ' 95 'security_group_rules_for_devices which scales '
97 'worse.')) 96 'worse.')
98 return False 97 return False
99 return True 98 return True
100 99
@@ -103,8 +102,8 @@ class SecurityGroupAgentRpc(object):
103 def decorated_function(self, *args, **kwargs): 102 def decorated_function(self, *args, **kwargs):
104 if (isinstance(self.firewall, firewall.NoopFirewallDriver) or 103 if (isinstance(self.firewall, firewall.NoopFirewallDriver) or
105 not is_firewall_enabled()): 104 not is_firewall_enabled()):
106 LOG.info(_LI("Skipping method %s as firewall is disabled " 105 LOG.info("Skipping method %s as firewall is disabled "
107 "or configured as NoopFirewallDriver."), 106 "or configured as NoopFirewallDriver.",
108 func.__name__) 107 func.__name__)
109 else: 108 else:
110 return func(self, # pylint: disable=not-callable 109 return func(self, # pylint: disable=not-callable
@@ -115,7 +114,7 @@ class SecurityGroupAgentRpc(object):
115 def prepare_devices_filter(self, device_ids): 114 def prepare_devices_filter(self, device_ids):
116 if not device_ids: 115 if not device_ids:
117 return 116 return
118 LOG.info(_LI("Preparing filters for devices %s"), device_ids) 117 LOG.info("Preparing filters for devices %s", device_ids)
119 self._apply_port_filter(device_ids) 118 self._apply_port_filter(device_ids)
120 119
121 def _apply_port_filter(self, device_ids, update_filter=False): 120 def _apply_port_filter(self, device_ids, update_filter=False):
@@ -155,16 +154,16 @@ class SecurityGroupAgentRpc(object):
155 remote_sg_id, member_ips) 154 remote_sg_id, member_ips)
156 155
157 def security_groups_rule_updated(self, security_groups): 156 def security_groups_rule_updated(self, security_groups):
158 LOG.info(_LI("Security group " 157 LOG.info("Security group "
159 "rule updated %r"), security_groups) 158 "rule updated %r", security_groups)
160 self._security_group_updated( 159 self._security_group_updated(
161 security_groups, 160 security_groups,
162 'security_groups', 161 'security_groups',
163 'sg_rule') 162 'sg_rule')
164 163
165 def security_groups_member_updated(self, security_groups): 164 def security_groups_member_updated(self, security_groups):
166 LOG.info(_LI("Security group " 165 LOG.info("Security group "
167 "member updated %r"), security_groups) 166 "member updated %r", security_groups)
168 self._security_group_updated( 167 self._security_group_updated(
169 security_groups, 168 security_groups,
170 'security_group_source_groups', 169 'security_group_source_groups',
@@ -188,7 +187,7 @@ class SecurityGroupAgentRpc(object):
188 self.refresh_firewall(devices) 187 self.refresh_firewall(devices)
189 188
190 def security_groups_provider_updated(self, port_ids_to_update): 189 def security_groups_provider_updated(self, port_ids_to_update):
191 LOG.info(_LI("Provider rule updated")) 190 LOG.info("Provider rule updated")
192 if port_ids_to_update is None: 191 if port_ids_to_update is None:
193 # Update all devices 192 # Update all devices
194 if self.defer_refresh_firewall: 193 if self.defer_refresh_firewall:
@@ -211,7 +210,7 @@ class SecurityGroupAgentRpc(object):
211 def remove_devices_filter(self, device_ids): 210 def remove_devices_filter(self, device_ids):
212 if not device_ids: 211 if not device_ids:
213 return 212 return
214 LOG.info(_LI("Remove device filter for %r"), device_ids) 213 LOG.info("Remove device filter for %r", device_ids)
215 with self.firewall.defer_apply(): 214 with self.firewall.defer_apply():
216 for device_id in device_ids: 215 for device_id in device_ids:
217 device = self.firewall.ports.get(device_id) 216 device = self.firewall.ports.get(device_id)
@@ -222,11 +221,11 @@ class SecurityGroupAgentRpc(object):
222 221
223 @skip_if_noopfirewall_or_firewall_disabled 222 @skip_if_noopfirewall_or_firewall_disabled
224 def refresh_firewall(self, device_ids=None): 223 def refresh_firewall(self, device_ids=None):
225 LOG.info(_LI("Refresh firewall rules")) 224 LOG.info("Refresh firewall rules")
226 if not device_ids: 225 if not device_ids:
227 device_ids = self.firewall.ports.keys() 226 device_ids = self.firewall.ports.keys()
228 if not device_ids: 227 if not device_ids:
229 LOG.info(_LI("No ports here to refresh firewall")) 228 LOG.info("No ports here to refresh firewall")
230 return 229 return
231 self._apply_port_filter(device_ids, update_filter=True) 230 self._apply_port_filter(device_ids, update_filter=True)
232 231
diff --git a/neutron/agent/windows/ip_lib.py b/neutron/agent/windows/ip_lib.py
index cd24391..bae94e4 100644
--- a/neutron/agent/windows/ip_lib.py
+++ b/neutron/agent/windows/ip_lib.py
@@ -17,8 +17,6 @@ import netifaces
17 17
18from oslo_log import log as logging 18from oslo_log import log as logging
19 19
20from neutron._i18n import _LE
21
22LOG = logging.getLogger(__name__) 20LOG = logging.getLogger(__name__)
23 21
24OPTS = [] 22OPTS = []
@@ -38,7 +36,7 @@ class IPWrapper(object):
38 try: 36 try:
39 return [IPDevice(iface) for iface in netifaces.interfaces()] 37 return [IPDevice(iface) for iface in netifaces.interfaces()]
40 except (OSError, MemoryError): 38 except (OSError, MemoryError):
41 LOG.error(_LE("Failed to get network interfaces.")) 39 LOG.error("Failed to get network interfaces.")
42 return [] 40 return []
43 41
44 42
@@ -52,11 +50,11 @@ class IPDevice(object):
52 try: 50 try:
53 device_addresses = netifaces.ifaddresses(self.name) 51 device_addresses = netifaces.ifaddresses(self.name)
54 except ValueError: 52 except ValueError:
55 LOG.error(_LE("The device does not exist on the system: %s."), 53 LOG.error("The device does not exist on the system: %s.",
56 self.name) 54 self.name)
57 return 55 return
58 except OSError: 56 except OSError:
59 LOG.error(_LE("Failed to get interface addresses: %s."), 57 LOG.error("Failed to get interface addresses: %s.",
60 self.name) 58 self.name)
61 return 59 return
62 return device_addresses 60 return device_addresses
diff --git a/neutron/api/api_common.py b/neutron/api/api_common.py
index b8155c0..aac92bf 100644
--- a/neutron/api/api_common.py
+++ b/neutron/api/api_common.py
@@ -24,7 +24,7 @@ from oslo_serialization import jsonutils
24from six.moves.urllib import parse 24from six.moves.urllib import parse
25from webob import exc 25from webob import exc
26 26
27from neutron._i18n import _, _LW 27from neutron._i18n import _
28from neutron.api import extensions 28from neutron.api import extensions
29from neutron.common import constants 29from neutron.common import constants
30from neutron import wsgi 30from neutron import wsgi
@@ -153,8 +153,8 @@ def _get_pagination_max_limit():
153 if max_limit == 0: 153 if max_limit == 0:
154 raise ValueError() 154 raise ValueError()
155 except ValueError: 155 except ValueError:
156 LOG.warning(_LW("Invalid value for pagination_max_limit: %s. It " 156 LOG.warning("Invalid value for pagination_max_limit: %s. It "
157 "should be an integer greater to 0"), 157 "should be an integer greater to 0",
158 cfg.CONF.pagination_max_limit) 158 cfg.CONF.pagination_max_limit)
159 return max_limit 159 return max_limit
160 160
diff --git a/neutron/api/extensions.py b/neutron/api/extensions.py
index 927e434..bcddb6f 100644
--- a/neutron/api/extensions.py
+++ b/neutron/api/extensions.py
@@ -26,7 +26,7 @@ import routes
26import webob.dec 26import webob.dec
27import webob.exc 27import webob.exc
28 28
29from neutron._i18n import _, _LE, _LI, _LW 29from neutron._i18n import _
30from neutron.common import exceptions 30from neutron.common import exceptions
31from neutron import extensions as core_extensions 31from neutron import extensions as core_extensions
32from neutron.plugins.common import constants as const 32from neutron.plugins.common import constants as const
@@ -283,7 +283,7 @@ class ExtensionManager(object):
283 """ 283 """
284 284
285 def __init__(self, path): 285 def __init__(self, path):
286 LOG.info(_LI('Initializing extension manager.')) 286 LOG.info('Initializing extension manager.')
287 self.path = path 287 self.path = path
288 self.extensions = {} 288 self.extensions = {}
289 self._load_all_extensions() 289 self._load_all_extensions()
@@ -359,10 +359,10 @@ class ExtensionManager(object):
359 break 359 break
360 if exts_to_process: 360 if exts_to_process:
361 unloadable_extensions = set(exts_to_process.keys()) 361 unloadable_extensions = set(exts_to_process.keys())
362 LOG.error(_LE("Unable to process extensions (%s) because " 362 LOG.error("Unable to process extensions (%s) because "
363 "the configured plugins do not satisfy " 363 "the configured plugins do not satisfy "
364 "their requirements. Some features will not " 364 "their requirements. Some features will not "
365 "work as expected."), 365 "work as expected.",
366 ', '.join(unloadable_extensions)) 366 ', '.join(unloadable_extensions))
367 self._check_faulty_extensions(unloadable_extensions) 367 self._check_faulty_extensions(unloadable_extensions)
368 # Extending extensions' attributes map. 368 # Extending extensions' attributes map.
@@ -398,7 +398,7 @@ class ExtensionManager(object):
398 'desc': extension.get_description(), 398 'desc': extension.get_description(),
399 'updated': extension.get_updated()}) 399 'updated': extension.get_updated()})
400 except AttributeError: 400 except AttributeError:
401 LOG.exception(_LE("Exception loading extension")) 401 LOG.exception("Exception loading extension")
402 return False 402 return False
403 return isinstance(extension, api_extensions.ExtensionDescriptor) 403 return isinstance(extension, api_extensions.ExtensionDescriptor)
404 404
@@ -417,7 +417,7 @@ class ExtensionManager(object):
417 if os.path.exists(path): 417 if os.path.exists(path):
418 self._load_all_extensions_from_path(path) 418 self._load_all_extensions_from_path(path)
419 else: 419 else:
420 LOG.error(_LE("Extension path '%s' doesn't exist!"), path) 420 LOG.error("Extension path '%s' doesn't exist!", path)
421 421
422 def _load_all_extensions_from_path(self, path): 422 def _load_all_extensions_from_path(self, path):
423 # Sorting the extension list makes the order in which they 423 # Sorting the extension list makes the order in which they
@@ -433,16 +433,16 @@ class ExtensionManager(object):
433 ext_name = mod_name.capitalize() 433 ext_name = mod_name.capitalize()
434 new_ext_class = getattr(mod, ext_name, None) 434 new_ext_class = getattr(mod, ext_name, None)
435 if not new_ext_class: 435 if not new_ext_class:
436 LOG.warning(_LW('Did not find expected name ' 436 LOG.warning('Did not find expected name '
437 '"%(ext_name)s" in %(file)s'), 437 '"%(ext_name)s" in %(file)s',
438 {'ext_name': ext_name, 438 {'ext_name': ext_name,
439 'file': ext_path}) 439 'file': ext_path})
440 continue 440 continue
441 new_ext = new_ext_class() 441 new_ext = new_ext_class()
442 self.add_extension(new_ext) 442 self.add_extension(new_ext)
443 except Exception as exception: 443 except Exception as exception:
444 LOG.warning(_LW("Extension file %(f)s wasn't loaded due to " 444 LOG.warning("Extension file %(f)s wasn't loaded due to "
445 "%(exception)s"), 445 "%(exception)s",
446 {'f': f, 'exception': exception}) 446 {'f': f, 'exception': exception})
447 447
448 def add_extension(self, ext): 448 def add_extension(self, ext):
@@ -451,7 +451,7 @@ class ExtensionManager(object):
451 return 451 return
452 452
453 alias = ext.get_alias() 453 alias = ext.get_alias()
454 LOG.info(_LI('Loaded extension: %s'), alias) 454 LOG.info('Loaded extension: %s', alias)
455 455
456 if alias in self.extensions: 456 if alias in self.extensions:
457 raise exceptions.DuplicatedExtension(alias=alias) 457 raise exceptions.DuplicatedExtension(alias=alias)
@@ -485,9 +485,8 @@ class PluginAwareExtensionManager(ExtensionManager):
485 alias = extension.get_alias() 485 alias = extension.get_alias()
486 supports_extension = alias in self.get_supported_extension_aliases() 486 supports_extension = alias in self.get_supported_extension_aliases()
487 if not supports_extension: 487 if not supports_extension:
488 LOG.info(_LI("Extension %s not supported by any of loaded " 488 LOG.info("Extension %s not supported by any of loaded "
489 "plugins"), 489 "plugins", alias)
490 alias)
491 return supports_extension 490 return supports_extension
492 491
493 def _plugins_implement_interface(self, extension): 492 def _plugins_implement_interface(self, extension):
@@ -496,8 +495,8 @@ class PluginAwareExtensionManager(ExtensionManager):
496 for plugin in self.plugins.values(): 495 for plugin in self.plugins.values():
497 if isinstance(plugin, extension.get_plugin_interface()): 496 if isinstance(plugin, extension.get_plugin_interface()):
498 return True 497 return True
499 LOG.warning(_LW("Loaded plugins do not implement extension " 498 LOG.warning("Loaded plugins do not implement extension "
500 "%s interface"), 499 "%s interface",
501 extension.get_alias()) 500 extension.get_alias())
502 return False 501 return False
503 502
diff --git a/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
index 24dcf2e..64a2a67 100644
--- a/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
+++ b/neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
@@ -22,7 +22,6 @@ from oslo_config import cfg
22from oslo_log import log as logging 22from oslo_log import log as logging
23import oslo_messaging 23import oslo_messaging
24 24
25from neutron._i18n import _LE, _LW
26from neutron.common import constants as n_const 25from neutron.common import constants as n_const
27from neutron.common import rpc as n_rpc 26from neutron.common import rpc as n_rpc
28from neutron.common import topics 27from neutron.common import topics
@@ -105,9 +104,9 @@ class DhcpAgentNotifyAPI(object):
105 context, 'network_create_end', 104 context, 'network_create_end',
106 {'network': {'id': network['id']}}, agent['host']) 105 {'network': {'id': network['id']}}, agent['host'])
107 elif not existing_agents: 106 elif not existing_agents:
108 LOG.warning(_LW('Unable to schedule network %s: no agents ' 107 LOG.warning('Unable to schedule network %s: no agents '
109 'available; will retry on subsequent port ' 108 'available; will retry on subsequent port '
110 'and subnet creation events.'), 109 'and subnet creation events.',
111 network['id']) 110 network['id'])
112 return new_agents + existing_agents 111 return new_agents + existing_agents
113 112
@@ -123,10 +122,10 @@ class DhcpAgentNotifyAPI(object):
123 len_enabled_agents = len(enabled_agents) 122 len_enabled_agents = len(enabled_agents)
124 len_active_agents = len(active_agents) 123 len_active_agents = len(active_agents)
125 if len_active_agents < len_enabled_agents: 124 if len_active_agents < len_enabled_agents:
126 LOG.warning(_LW("Only %(active)d of %(total)d DHCP agents " 125 LOG.warning("Only %(active)d of %(total)d DHCP agents "
127 "associated with network '%(net_id)s' " 126 "associated with network '%(net_id)s' "
128 "are marked as active, so notifications " 127 "are marked as active, so notifications "
129 "may be sent to inactive agents."), 128 "may be sent to inactive agents.",
130 {'active': len_active_agents, 129 {'active': len_active_agents,
131 'total': len_enabled_agents, 130 'total': len_enabled_agents,
132 'net_id': network_id}) 131 'net_id': network_id})
@@ -136,9 +135,9 @@ class DhcpAgentNotifyAPI(object):
136 notification_required = ( 135 notification_required = (
137 num_ports > 0 and len(network['subnets']) >= 1) 136 num_ports > 0 and len(network['subnets']) >= 1)
138 if notification_required: 137 if notification_required:
139 LOG.error(_LE("Will not send event %(method)s for network " 138 LOG.error("Will not send event %(method)s for network "
140 "%(net_id)s: no agent available. Payload: " 139 "%(net_id)s: no agent available. Payload: "
141 "%(payload)s"), 140 "%(payload)s",
142 {'method': method, 141 {'method': method,
143 'net_id': network_id, 142 'net_id': network_id,
144 'payload': payload}) 143 'payload': payload})
diff --git a/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py b/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
index fff43c3..cde4c77 100644
--- a/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
+++ b/neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
@@ -21,7 +21,6 @@ from neutron_lib.plugins import directory
21from oslo_log import log as logging 21from oslo_log import log as logging
22import oslo_messaging 22import oslo_messaging
23 23
24from neutron._i18n import _LE
25from neutron.api.rpc.agentnotifiers import utils as ag_utils 24from neutron.api.rpc.agentnotifiers import utils as ag_utils
26from neutron.common import rpc as n_rpc 25from neutron.common import rpc as n_rpc
27from neutron.common import topics 26from neutron.common import topics
@@ -88,8 +87,8 @@ class L3AgentNotifyAPI(object):
88 """Notify all the agents that are hosting the routers.""" 87 """Notify all the agents that are hosting the routers."""
89 plugin = directory.get_plugin(plugin_constants.L3) 88 plugin = directory.get_plugin(plugin_constants.L3)
90 if not plugin: 89 if not plugin:
91 LOG.error(_LE('No plugin for L3 routing registered. Cannot notify ' 90 LOG.error('No plugin for L3 routing registered. Cannot notify '
92 'agents with the message %s'), method) 91 'agents with the message %s', method)
93 return 92 return
94 if utils.is_extension_supported( 93 if utils.is_extension_supported(
95 plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS): 94 plugin, constants.L3_AGENT_SCHEDULER_EXT_ALIAS):
diff --git a/neutron/api/rpc/agentnotifiers/utils.py b/neutron/api/rpc/agentnotifiers/utils.py
index 65ae99a..dd004fc 100644
--- a/neutron/api/rpc/agentnotifiers/utils.py
+++ b/neutron/api/rpc/agentnotifiers/utils.py
@@ -17,8 +17,6 @@ from oslo_log import log as logging
17import oslo_messaging 17import oslo_messaging
18from oslo_utils import excutils 18from oslo_utils import excutils
19 19
20from neutron._i18n import _LW
21
22LOG = logging.getLogger(__name__) 20LOG = logging.getLogger(__name__)
23 21
24 22
@@ -42,8 +40,8 @@ def _call_with_retry(max_attempts):
42 with excutils.save_and_reraise_exception( 40 with excutils.save_and_reraise_exception(
43 reraise=False) as ctxt: 41 reraise=False) as ctxt:
44 LOG.warning( 42 LOG.warning(
45 _LW('Failed to execute %(action)s. %(attempt)d out' 43 'Failed to execute %(action)s. %(attempt)d out'
46 ' of %(max_attempts)d'), 44 ' of %(max_attempts)d',
47 {'attempt': attempt, 45 {'attempt': attempt,
48 'max_attempts': max_attempts, 46 'max_attempts': max_attempts,
49 'action': action}) 47 'action': action})
diff --git a/neutron/api/rpc/handlers/dhcp_rpc.py b/neutron/api/rpc/handlers/dhcp_rpc.py
index 1001566..5681761 100644
--- a/neutron/api/rpc/handlers/dhcp_rpc.py
+++ b/neutron/api/rpc/handlers/dhcp_rpc.py
@@ -28,7 +28,7 @@ from oslo_log import log as logging
28import oslo_messaging 28import oslo_messaging
29from oslo_utils import excutils 29from oslo_utils import excutils
30 30
31from neutron._i18n import _, _LW 31from neutron._i18n import _
32from neutron.common import constants as n_const 32from neutron.common import constants as n_const
33from neutron.common import exceptions as n_exc 33from neutron.common import exceptions as n_exc
34from neutron.common import utils 34from neutron.common import utils
@@ -120,9 +120,9 @@ class DhcpRpcCallback(object):
120 ctxt.reraise = True 120 ctxt.reraise = True
121 if ctxt.reraise: 121 if ctxt.reraise:
122 net_id = port['port']['network_id'] 122 net_id = port['port']['network_id']
123 LOG.warning(_LW("Action %(action)s for network %(net_id)s " 123 LOG.warning("Action %(action)s for network %(net_id)s "
124 "could not complete successfully: " 124 "could not complete successfully: "
125 "%(reason)s"), 125 "%(reason)s",
126 {"action": action, 126 {"action": action,
127 "net_id": net_id, 127 "net_id": net_id,
128 'reason': e}) 128 'reason': e})
diff --git a/neutron/api/rpc/handlers/securitygroups_rpc.py b/neutron/api/rpc/handlers/securitygroups_rpc.py
index 379d778..44d0ecf 100644
--- a/neutron/api/rpc/handlers/securitygroups_rpc.py
+++ b/neutron/api/rpc/handlers/securitygroups_rpc.py
@@ -19,7 +19,6 @@ from neutron_lib.utils import net
19from oslo_log import log as logging 19from oslo_log import log as logging
20import oslo_messaging 20import oslo_messaging
21 21
22from neutron._i18n import _LW
23from neutron.api.rpc.handlers import resources_rpc 22from neutron.api.rpc.handlers import resources_rpc
24from neutron.callbacks import events 23from neutron.callbacks import events
25from neutron.callbacks import registry 24from neutron.callbacks import registry
@@ -192,9 +191,9 @@ class SecurityGroupAgentRpcCallbackMixin(object):
192 sg_agent = None 191 sg_agent = None
193 192
194 def _security_groups_agent_not_set(self): 193 def _security_groups_agent_not_set(self):
195 LOG.warning(_LW("Security group agent binding currently not set. " 194 LOG.warning("Security group agent binding currently not set. "
196 "This should be set by the end of the init " 195 "This should be set by the end of the init "
197 "process.")) 196 "process.")
198 197
199 def security_groups_rule_updated(self, context, **kwargs): 198 def security_groups_rule_updated(self, context, **kwargs):
200 """Callback for security group rule update. 199 """Callback for security group rule update.
diff --git a/neutron/api/v2/base.py b/neutron/api/v2/base.py
index 9c21a70..857dc19 100644
--- a/neutron/api/v2/base.py
+++ b/neutron/api/v2/base.py
@@ -26,7 +26,7 @@ from oslo_policy import policy as oslo_policy
26from oslo_utils import excutils 26from oslo_utils import excutils
27import webob.exc 27import webob.exc
28 28
29from neutron._i18n import _, _LE, _LI 29from neutron._i18n import _
30from neutron.api import api_common 30from neutron.api import api_common
31from neutron.api.v2 import resource as wsgi_resource 31from neutron.api.v2 import resource as wsgi_resource
32from neutron.common import constants as n_const 32from neutron.common import constants as n_const
@@ -125,8 +125,8 @@ class Controller(object):
125 _("Native pagination depend on native sorting") 125 _("Native pagination depend on native sorting")
126 ) 126 )
127 if not self._allow_sorting: 127 if not self._allow_sorting:
128 LOG.info(_LI("Allow sorting is enabled because native " 128 LOG.info("Allow sorting is enabled because native "
129 "pagination requires native sorting")) 129 "pagination requires native sorting")
130 self._allow_sorting = True 130 self._allow_sorting = True
131 self.parent = parent 131 self.parent = parent
132 if parent: 132 if parent:
@@ -419,8 +419,8 @@ class Controller(object):
419 except Exception: 419 except Exception:
420 # broad catch as our only purpose is to log the 420 # broad catch as our only purpose is to log the
421 # exception 421 # exception
422 LOG.exception(_LE("Unable to undo add for " 422 LOG.exception("Unable to undo add for "
423 "%(resource)s %(id)s"), 423 "%(resource)s %(id)s",
424 {'resource': self._resource, 424 {'resource': self._resource,
425 'id': obj['id']}) 425 'id': obj['id']})
426 # TODO(salvatore-orlando): The object being processed when the 426 # TODO(salvatore-orlando): The object being processed when the
diff --git a/neutron/api/v2/resource.py b/neutron/api/v2/resource.py
index 5721ab5..a272a13 100644
--- a/neutron/api/v2/resource.py
+++ b/neutron/api/v2/resource.py
@@ -21,7 +21,6 @@ from oslo_log import log as logging
21import webob.dec 21import webob.dec
22import webob.exc 22import webob.exc
23 23
24from neutron._i18n import _LE, _LI
25from neutron.api import api_common 24from neutron.api import api_common
26from neutron.common import utils 25from neutron.common import utils
27from neutron import wsgi 26from neutron import wsgi
@@ -101,16 +100,15 @@ def Resource(controller, faults=None, deserializers=None, serializers=None,
101 mapped_exc = api_common.convert_exception_to_http_exc(e, faults, 100 mapped_exc = api_common.convert_exception_to_http_exc(e, faults,
102 language) 101 language)
103 if hasattr(mapped_exc, 'code') and 400 <= mapped_exc.code < 500: 102 if hasattr(mapped_exc, 'code') and 400 <= mapped_exc.code < 500:
104 LOG.info(_LI('%(action)s failed (client error): %(exc)s'), 103 LOG.info('%(action)s failed (client error): %(exc)s',
105 {'action': action, 'exc': mapped_exc}) 104 {'action': action, 'exc': mapped_exc})
106 else: 105 else:
107 LOG.exception( 106 LOG.exception('%(action)s failed: %(details)s',
108 _LE('%(action)s failed: %(details)s'), 107 {
109 { 108 'action': action,
110 'action': action, 109 'details': utils.extract_exc_details(e),
111 'details': utils.extract_exc_details(e), 110 }
112 } 111 )
113 )
114 raise mapped_exc 112 raise mapped_exc
115 113
116 status = action_status.get(action, 200) 114 status = action_status.get(action, 200)
diff --git a/neutron/cmd/ipset_cleanup.py b/neutron/cmd/ipset_cleanup.py
index 053b179..914e5e1 100644
--- a/neutron/cmd/ipset_cleanup.py
+++ b/neutron/cmd/ipset_cleanup.py
@@ -16,7 +16,6 @@
16from oslo_config import cfg 16from oslo_config import cfg
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron._i18n import _LE, _LI
20from neutron.agent.linux import utils 19from neutron.agent.linux import utils
21from neutron.common import config 20from neutron.common import config
22from neutron.conf.agent import cmd as command 21from neutron.conf.agent import cmd as command
@@ -43,7 +42,7 @@ def remove_iptables_reference(ipset):
43 42
44 if ipset in iptables_save: 43 if ipset in iptables_save:
45 cmd = ['iptables'] if 'IPv4' in ipset else ['ip6tables'] 44 cmd = ['iptables'] if 'IPv4' in ipset else ['ip6tables']
46 LOG.info(_LI("Removing iptables rule for IPset: %s"), ipset) 45 LOG.info("Removing iptables rule for IPset: %s", ipset)
47 for rule in iptables_save.splitlines(): 46 for rule in iptables_save.splitlines():
48 if '--match-set %s ' % ipset in rule and rule.startswith('-A'): 47 if '--match-set %s ' % ipset in rule and rule.startswith('-A'):
49 # change to delete 48 # change to delete
@@ -52,8 +51,8 @@ def remove_iptables_reference(ipset):
52 try: 51 try:
53 utils.execute(cmd + params, run_as_root=True) 52 utils.execute(cmd + params, run_as_root=True)
54 except Exception: 53 except Exception:
55 LOG.exception(_LE('Error, unable to remove iptables rule ' 54 LOG.exception('Error, unable to remove iptables rule '
56 'for IPset: %s'), ipset) 55 'for IPset: %s', ipset)
57 56
58 57
59def destroy_ipset(conf, ipset): 58def destroy_ipset(conf, ipset):
@@ -62,17 +61,17 @@ def destroy_ipset(conf, ipset):
62 if conf.force: 61 if conf.force:
63 remove_iptables_reference(ipset) 62 remove_iptables_reference(ipset)
64 63
65 LOG.info(_LI("Destroying IPset: %s"), ipset) 64 LOG.info("Destroying IPset: %s", ipset)
66 cmd = ['ipset', 'destroy', ipset] 65 cmd = ['ipset', 'destroy', ipset]
67 try: 66 try:
68 utils.execute(cmd, run_as_root=True) 67 utils.execute(cmd, run_as_root=True)
69 except Exception: 68 except Exception:
70 LOG.exception(_LE('Error, unable to destroy IPset: %s'), ipset) 69 LOG.exception('Error, unable to destroy IPset: %s', ipset)
71 70
72 71
73def cleanup_ipsets(conf): 72def cleanup_ipsets(conf):
74 # Identify ipsets for destruction. 73 # Identify ipsets for destruction.
75 LOG.info(_LI("Destroying IPsets with prefix: %s"), conf.prefix) 74 LOG.info("Destroying IPsets with prefix: %s", conf.prefix)
76 75
77 cmd = ['ipset', '-L', '-n'] 76 cmd = ['ipset', '-L', '-n']
78 ipsets = utils.execute(cmd, run_as_root=True) 77 ipsets = utils.execute(cmd, run_as_root=True)
@@ -80,7 +79,7 @@ def cleanup_ipsets(conf):
80 if conf.allsets or ipset.startswith(conf.prefix): 79 if conf.allsets or ipset.startswith(conf.prefix):
81 destroy_ipset(conf, ipset) 80 destroy_ipset(conf, ipset)
82 81
83 LOG.info(_LI("IPset cleanup completed successfully")) 82 LOG.info("IPset cleanup completed successfully")
84 83
85 84
86def main(): 85def main():
diff --git a/neutron/cmd/linuxbridge_cleanup.py b/neutron/cmd/linuxbridge_cleanup.py
index 0965da8..9853c6e 100644
--- a/neutron/cmd/linuxbridge_cleanup.py
+++ b/neutron/cmd/linuxbridge_cleanup.py
@@ -16,7 +16,6 @@ from neutron_lib.utils import helpers
16from oslo_config import cfg 16from oslo_config import cfg
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron._i18n import _LE, _LI
20from neutron.common import config 19from neutron.common import config
21from neutron.plugins.ml2.drivers.linuxbridge.agent \ 20from neutron.plugins.ml2.drivers.linuxbridge.agent \
22 import linuxbridge_neutron_agent 21 import linuxbridge_neutron_agent
@@ -30,17 +29,17 @@ def remove_empty_bridges():
30 interface_mappings = helpers.parse_mappings( 29 interface_mappings = helpers.parse_mappings(
31 cfg.CONF.LINUX_BRIDGE.physical_interface_mappings) 30 cfg.CONF.LINUX_BRIDGE.physical_interface_mappings)
32 except ValueError as e: 31 except ValueError as e:
33 LOG.error(_LE("Parsing physical_interface_mappings failed: %s."), e) 32 LOG.error("Parsing physical_interface_mappings failed: %s.", e)
34 sys.exit(1) 33 sys.exit(1)
35 LOG.info(_LI("Interface mappings: %s."), interface_mappings) 34 LOG.info("Interface mappings: %s.", interface_mappings)
36 35
37 try: 36 try:
38 bridge_mappings = helpers.parse_mappings( 37 bridge_mappings = helpers.parse_mappings(
39 cfg.CONF.LINUX_BRIDGE.bridge_mappings) 38 cfg.CONF.LINUX_BRIDGE.bridge_mappings)
40 except ValueError as e: 39 except ValueError as e:
41 LOG.error(_LE("Parsing bridge_mappings failed: %s."), e) 40 LOG.error("Parsing bridge_mappings failed: %s.", e)
42 sys.exit(1) 41 sys.exit(1)
43 LOG.info(_LI("Bridge mappings: %s."), bridge_mappings) 42 LOG.info("Bridge mappings: %s.", bridge_mappings)
44 43
45 lb_manager = linuxbridge_neutron_agent.LinuxBridgeManager( 44 lb_manager = linuxbridge_neutron_agent.LinuxBridgeManager(
46 bridge_mappings, interface_mappings) 45 bridge_mappings, interface_mappings)
@@ -52,10 +51,10 @@ def remove_empty_bridges():
52 51
53 try: 52 try:
54 lb_manager.delete_bridge(bridge_name) 53 lb_manager.delete_bridge(bridge_name)
55 LOG.info(_LI("Linux bridge %s deleted"), bridge_name) 54 LOG.info("Linux bridge %s deleted", bridge_name)
56 except RuntimeError: 55 except RuntimeError:
57 LOG.exception(_LE("Linux bridge %s delete failed"), bridge_name) 56 LOG.exception("Linux bridge %s delete failed", bridge_name)
58 LOG.info(_LI("Linux bridge cleanup completed successfully")) 57 LOG.info("Linux bridge cleanup completed successfully")
59 58
60 59
61def main(): 60def main():
diff --git a/neutron/cmd/netns_cleanup.py b/neutron/cmd/netns_cleanup.py
index b16f82b..247f6e5 100644
--- a/neutron/cmd/netns_cleanup.py
+++ b/neutron/cmd/netns_cleanup.py
@@ -23,7 +23,6 @@ from oslo_config import cfg
23from oslo_log import log as logging 23from oslo_log import log as logging
24from oslo_utils import importutils 24from oslo_utils import importutils
25 25
26from neutron._i18n import _LE, _LW
27from neutron.agent.common import ovs_lib 26from neutron.agent.common import ovs_lib
28from neutron.agent.l3 import dvr_fip_ns 27from neutron.agent.l3 import dvr_fip_ns
29from neutron.agent.l3 import dvr_snat_ns 28from neutron.agent.l3 import dvr_snat_ns
@@ -197,7 +196,7 @@ def _kill_listen_processes(namespace, force=False):
197 # implementation in the right module. Ideally, netns_cleanup wouldn't 196 # implementation in the right module. Ideally, netns_cleanup wouldn't
198 # kill any processes as the responsible module should've killed them 197 # kill any processes as the responsible module should've killed them
199 # before cleaning up the namespace 198 # before cleaning up the namespace
200 LOG.warning(_LW("Killing (%(signal)d) [%(pid)s] %(cmdline)s"), 199 LOG.warning("Killing (%(signal)d) [%(pid)s] %(cmdline)s",
201 {'signal': kill_signal, 200 {'signal': kill_signal,
202 'pid': pid, 201 'pid': pid,
203 'cmdline': ' '.join(utils.get_cmdline_from_pid(pid))[:80] 202 'cmdline': ' '.join(utils.get_cmdline_from_pid(pid))[:80]
@@ -205,8 +204,8 @@ def _kill_listen_processes(namespace, force=False):
205 try: 204 try:
206 utils.kill_process(pid, kill_signal, run_as_root=True) 205 utils.kill_process(pid, kill_signal, run_as_root=True)
207 except Exception as ex: 206 except Exception as ex:
208 LOG.error(_LE('An error occurred while killing ' 207 LOG.error('An error occurred while killing '
209 '[%(pid)s]: %(msg)s'), {'pid': pid, 'msg': ex}) 208 '[%(pid)s]: %(msg)s', {'pid': pid, 'msg': ex})
210 return len(pids) 209 return len(pids)
211 210
212 211
@@ -246,14 +245,14 @@ def destroy_namespace(conf, namespace, force=False):
246 # This is unlikely since, at this point, we have SIGKILLed 245 # This is unlikely since, at this point, we have SIGKILLed
247 # all remaining processes but if there are still some, log 246 # all remaining processes but if there are still some, log
248 # the error and continue with the cleanup 247 # the error and continue with the cleanup
249 LOG.error(_LE('Not all processes were killed in %s'), 248 LOG.error('Not all processes were killed in %s',
250 namespace) 249 namespace)
251 for device in ip.get_devices(): 250 for device in ip.get_devices():
252 unplug_device(conf, device) 251 unplug_device(conf, device)
253 252
254 ip.garbage_collect_namespace() 253 ip.garbage_collect_namespace()
255 except Exception: 254 except Exception:
256 LOG.exception(_LE('Error unable to destroy namespace: %s'), namespace) 255 LOG.exception('Error unable to destroy namespace: %s', namespace)
257 256
258 257
259def cleanup_network_namespaces(conf): 258def cleanup_network_namespaces(conf):
diff --git a/neutron/cmd/ovs_cleanup.py b/neutron/cmd/ovs_cleanup.py
index c781fdf..dc53a6c 100644
--- a/neutron/cmd/ovs_cleanup.py
+++ b/neutron/cmd/ovs_cleanup.py
@@ -16,7 +16,6 @@
16from oslo_config import cfg 16from oslo_config import cfg
17from oslo_log import log as logging 17from oslo_log import log as logging
18 18
19from neutron._i18n import _LI
20from neutron.agent.common import ovs_lib 19from neutron.agent.common import ovs_lib
21from neutron.agent.linux import interface 20from neutron.agent.linux import interface
22from neutron.agent.linux import ip_lib 21from neutron.agent.linux import ip_lib
@@ -73,7 +72,7 @@ def delete_neutron_ports(ports):
73 device = ip_lib.IPDevice(port) 72 device = ip_lib.IPDevice(port)
74 if device.exists(): 73 if device.exists():
75 device.link.delete() 74 device.link.delete()
76 LOG.info(_LI("Deleting port: %s"), port) 75 LOG.info("Deleting port: %s", port)
77 76
78 77
79def main(): 78def main():
@@ -103,7 +102,7 @@ def main():
103 ports = collect_neutron_ports(available_configuration_bridges) 102 ports = collect_neutron_ports(available_configuration_bridges)
104 103
105 for bridge in bridges: 104 for bridge in bridges:
106 LOG.info(_LI("Cleaning bridge: %s"), bridge) 105 LOG.info("Cleaning bridge: %s", bridge)
107 ovs = ovs_lib.OVSBridge(bridge) 106 ovs = ovs_lib.OVSBridge(bridge)
108 if conf.ovs_all_ports: 107 if conf.ovs_all_ports:
109 port_names = ovs.get_port_name_list() 108 port_names = ovs.get_port_name_list()
@@ -115,4 +114,4 @@ def main():
115 # Remove remaining ports created by Neutron (usually veth pair) 114 # Remove remaining ports created by Neutron (usually veth pair)
116 delete_neutron_ports(ports) 115 delete_neutron_ports(ports)
117 116
118 LOG.info(_LI("OVS cleanup completed successfully")) 117 LOG.info("OVS cleanup completed successfully")
diff --git a/neutron/cmd/sanity/checks.py b/neutron/cmd/sanity/checks.py
index 8ea7555..753c7f6 100644
--- a/neutron/cmd/sanity/checks.py
+++ b/neutron/cmd/sanity/checks.py
@@ -23,7 +23,6 @@ from oslo_config import cfg
23from oslo_log import log as logging 23from oslo_log import log as logging
24from oslo_utils import uuidutils 24from oslo_utils import uuidutils
25 25
26from neutron._i18n import _LE
27from neutron.agent.common import ovs_lib 26from neutron.agent.common import ovs_lib
28from neutron.agent.l3 import ha_router 27from neutron.agent.l3 import ha_router
29from neutron.agent.l3 import namespaces 28from neutron.agent.l3 import namespaces
@@ -104,8 +103,8 @@ def ofctl_arg_supported(cmd, **kwargs):
104 "command %s. Exception: %s", full_args, e) 103 "command %s. Exception: %s", full_args, e)
105 return False 104 return False
106 except Exception: 105 except Exception:
107 LOG.exception(_LE("Unexpected exception while checking supported" 106 LOG.exception("Unexpected exception while checking supported"
108 " feature via command: %s"), full_args) 107 " feature via command: %s", full_args)
109 return False 108 return False
110 else: 109 else:
111 return True 110 return True
@@ -157,8 +156,8 @@ def _vf_management_support(required_caps):
157 LOG.debug("ip link command does not support " 156 LOG.debug("ip link command does not support "
158 "vf capability '%(cap)s'", {'cap': cap}) 157 "vf capability '%(cap)s'", {'cap': cap})
159 except ip_link_support.UnsupportedIpLinkCommand: 158 except ip_link_support.UnsupportedIpLinkCommand:
160 LOG.exception(_LE("Unexpected exception while checking supported " 159 LOG.exception("Unexpected exception while checking supported "
161 "ip link command")) 160 "ip link command")
162 return False 161 return False
163 return is_supported 162 return is_supported
164 163
@@ -362,11 +361,11 @@ def ovsdb_native_supported():
362 ovs.get_bridges() 361 ovs.get_bridges()
363 return True 362 return True
364 except ImportError as ex: 363 except ImportError as ex:
365 LOG.error(_LE("Failed to import required modules. Ensure that the " 364 LOG.error("Failed to import required modules. Ensure that the "
366 "python-openvswitch package is installed. Error: %s"), 365 "python-openvswitch package is installed. Error: %s",
367 ex) 366 ex)
368 except Exception: 367 except Exception:
369 LOG.exception(_LE("Unexpected exception occurred.")) 368 LOG.exception("Unexpected exception occurred.")
370 369
371 return False 370 return False
372 371
diff --git a/neutron/cmd/sanity_check.py b/neutron/cmd/sanity_check.py
index 0e1997e..e7de8c9 100644
--- a/neutron/cmd/sanity_check.py
+++ b/neutron/cmd/sanity_check.py
@@ -18,7 +18,7 @@ import sys
18from oslo_config import cfg 18from oslo_config import cfg
19from oslo_log import log as logging 19from oslo_log import log as logging
20 20
21from neutron._i18n import _, _LE, _LW 21from neutron._i18n import _
22from neutron.agent import dhcp_agent 22from neutron.agent import dhcp_agent
23from neutron.cmd.sanity import checks 23from neutron.cmd.sanity import checks
24from neutron.common import config 24from neutron.common import config
@@ -52,52 +52,52 @@ class BoolOptCallback(cfg.BoolOpt):
52def check_ovs_vxlan(): 52def check_ovs_vxlan():
53 result = checks.ovs_vxlan_supported() 53 result = checks.ovs_vxlan_supported()
54 if not result: 54 if not result:
55 LOG.error(_LE('Check for Open vSwitch VXLAN support failed. ' 55 LOG.error('Check for Open vSwitch VXLAN support failed. '
56 'Please ensure that the version of openvswitch ' 56 'Please ensure that the version of openvswitch '
57 'being used has VXLAN support.')) 57 'being used has VXLAN support.')
58 return result 58 return result
59 59
60 60
61def check_ovs_geneve(): 61def check_ovs_geneve():
62 result = checks.ovs_geneve_supported() 62 result = checks.ovs_geneve_supported()
63 if not result: 63 if not result:
64 LOG.error(_LE('Check for Open vSwitch Geneve support failed. ' 64 LOG.error('Check for Open vSwitch Geneve support failed. '
65 'Please ensure that the version of openvswitch ' 65 'Please ensure that the version of openvswitch '
66 'and kernel being used has Geneve support.')) 66 'and kernel being used has Geneve support.')
67 return result 67 return result
68 68
69 69
70def check_iproute2_vxlan(): 70def check_iproute2_vxlan():
71 result = checks.iproute2_vxlan_supported() 71 result = checks.iproute2_vxlan_supported()
72 if not result: 72 if not result:
73 LOG.error(_LE('Check for iproute2 VXLAN support failed. Please ensure ' 73 LOG.error('Check for iproute2 VXLAN support failed. Please ensure '
74 'that the iproute2 has VXLAN support.')) 74 'that the iproute2 has VXLAN support.')
75 return result 75 return result
76 76
77 77
78def check_ovs_patch(): 78def check_ovs_patch():
79 result = checks.patch_supported() 79 result = checks.patch_supported()
80 if not result: 80 if not result:
81 LOG.error(_LE('Check for Open vSwitch patch port support failed. ' 81 LOG.error('Check for Open vSwitch patch port support failed. '
82 'Please ensure that the version of openvswitch ' 82 'Please ensure that the version of openvswitch '
83 'being used has patch port support or disable features ' 83 'being used has patch port support or disable features '
84 'requiring patch ports (gre/vxlan, etc.).')) 84 'requiring patch ports (gre/vxlan, etc.).')
85 return result 85 return result
86 86
87 87
88def check_read_netns(): 88def check_read_netns():
89 required = checks.netns_read_requires_helper() 89 required = checks.netns_read_requires_helper()
90 if not required and cfg.CONF.AGENT.use_helper_for_ns_read: 90 if not required and cfg.CONF.AGENT.use_helper_for_ns_read:
91 LOG.warning(_LW("The user that is executing neutron can read the " 91 LOG.warning("The user that is executing neutron can read the "
92 "namespaces without using the root_helper. Disable " 92 "namespaces without using the root_helper. Disable "
93 "the use_helper_for_ns_read option to avoid a " 93 "the use_helper_for_ns_read option to avoid a "
94 "performance impact.")) 94 "performance impact.")
95 # Don't fail because nothing is actually broken. Just not optimal. 95 # Don't fail because nothing is actually broken. Just not optimal.
96 result = True 96 result = True
97 elif required and not cfg.CONF.AGENT.use_helper_for_ns_read: 97 elif required and not cfg.CONF.AGENT.use_helper_for_ns_read:
98 LOG.error(_LE("The user that is executing neutron does not have " 98 LOG.error("The user that is executing neutron does not have "
99 "permissions to read the namespaces. Enable the " 99 "permissions to read the namespaces. Enable the "
100 "use_helper_for_ns_read configuration option.")) 100 "use_helper_for_ns_read configuration option.")
101 result = False 101 result = False
102 else: 102 else:
103 # everything is configured appropriately 103 # everything is configured appropriately
@@ -112,8 +112,8 @@ def check_read_netns():
112def check_dnsmasq_version(): 112def check_dnsmasq_version():
113 result = checks.dnsmasq_version_supported() 113 result = checks.dnsmasq_version_supported()
114 if not result: 114 if not result:
115 LOG.error(_LE('The installed version of dnsmasq is too old. ' 115 LOG.error('The installed version of dnsmasq is too old. '
116 'Please update to at least version %s.'), 116 'Please update to at least version %s.',
117 checks.get_minimal_dnsmasq_version_supported()) 117 checks.get_minimal_dnsmasq_version_supported())
118 return result 118 return result
119 119
@@ -121,17 +121,17 @@ def check_dnsmasq_version():
121def check_keepalived_ipv6_support(): 121def check_keepalived_ipv6_support():
122 result = checks.keepalived_ipv6_supported() 122 result = checks.keepalived_ipv6_supported()
123 if not result: 123 if not result:
124 LOG.error(_LE('The installed version of keepalived does not support ' 124 LOG.error('The installed version of keepalived does not support '
125 'IPv6. Please update to at least version 1.2.10 for ' 125 'IPv6. Please update to at least version 1.2.10 for '
126 'IPv6 support.')) 126 'IPv6 support.')
127 return result 127 return result
128 128
129 129
130def check_dibbler_version(): 130def check_dibbler_version():
131 result = checks.dibbler_version_supported() 131 result = checks.dibbler_version_supported()
132 if not result: 132 if not result:
133 LOG.error(_LE('The installed version of dibbler-client is too old. ' 133 LOG.error('The installed version of dibbler-client is too old. '
134 'Please update to at least version %s.'), 134 'Please update to at least version %s.',
135 checks.get_minimal_dibbler_version_supported()) 135 checks.get_minimal_dibbler_version_supported())
136 return result 136 return result
137 137
@@ -139,56 +139,56 @@ def check_dibbler_version():
139def check_nova_notify(): 139def check_nova_notify():
140 result = checks.nova_notify_supported() 140 result = checks.nova_notify_supported()
141 if not result: 141 if not result:
142 LOG.error(_LE('Nova notifications are enabled, but novaclient is not ' 142 LOG.error('Nova notifications are enabled, but novaclient is not '
143 'installed. Either disable nova notifications or ' 143 'installed. Either disable nova notifications or '
144 'install python-novaclient.')) 144 'install python-novaclient.')
145 return result 145 return result
146 146
147 147
148def check_arp_responder(): 148def check_arp_responder():
149 result = checks.arp_responder_supported() 149 result = checks.arp_responder_supported()
150 if not result: 150 if not result:
151 LOG.error(_LE('Check for Open vSwitch ARP responder support failed. ' 151 LOG.error('Check for Open vSwitch ARP responder support failed. '
152 'Please ensure that the version of openvswitch ' 152 'Please ensure that the version of openvswitch '