From ff03b268f78693c781c83aec575777381f5bcb95 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Mon, 22 Dec 2014 15:41:28 +1100 Subject: [PATCH] ovs_dvr: Use lazy logging interpolation There are a small number of examples of "eager" interpolation in neutron: logging.debug("foo %s" % arg) These should be converted to perform the interpolation lazily within the logging function, since if the severity is below the logging level then the interpolation can be skipped entirely. This change addresses all such examples found in ovs agent via a pylint test. Other occurrences are addressed elsewhere. Change-Id: Ie215f33818cc5c16e570ace4c750df5371d27e09 Partial-Bug: #1404788 --- neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py index cd53e2a58..a4e2446cc 100644 --- a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py @@ -337,8 +337,9 @@ class OVSDVRNeutronAgent(dvr_rpc.DVRAgentRpcApiMixin): LOG.error(_LE("DVR: Unable to retrieve subnet information " "for subnet_id %s"), subnet_uuid) return - LOG.debug("get_subnet_for_dvr for subnet %s returned with %s" % - (subnet_uuid, subnet_info)) + LOG.debug("get_subnet_for_dvr for subnet %(uuid)s " + "returned with %(info)s", + {"uuid": subnet_uuid, "info": subnet_info}) ldm = LocalDVRSubnetMapping(subnet_info) self.local_dvr_map[subnet_uuid] = ldm -- 2.45.2