From: Angus Lees Date: Mon, 22 Dec 2014 04:41:28 +0000 (+1100) Subject: ovs_dvr: Use lazy logging interpolation X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ff03b268f78693c781c83aec575777381f5bcb95;p=openstack-build%2Fneutron-build.git 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 --- 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