From: Angus Lees Date: Mon, 22 Dec 2014 04:40:32 +0000 (+1100) Subject: linuxbridge: Use lazy logging interpolation X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4a5a8aab0f6a451642b459cdc510edb4e36a9858;p=openstack-build%2Fneutron-build.git linuxbridge: 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 linuxbridge agent via a pylint test. Other occurrences are addressed elsewhere. Change-Id: I5cb3bbb401f5049760dfe5263a52bd43f23dcfd4 Partial-Bug: #1404788 --- diff --git a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py index f4af61a76..7507d404c 100755 --- a/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py +++ b/neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py @@ -518,7 +518,7 @@ class LinuxBridgeManager: if not ip_lib.iproute_arg_supported( ['bridge', 'fdb'], 'append', self.root_helper): LOG.warning(_LW('Option "%(option)s" must be supported by command ' - '"%(command)s" to enable %(mode)s mode') % + '"%(command)s" to enable %(mode)s mode'), {'option': 'append', 'command': 'bridge fdb', 'mode': 'VXLAN UCAST'}) @@ -554,7 +554,7 @@ class LinuxBridgeManager: ['ip', 'link', 'add', 'type', 'vxlan'], 'proxy', self.root_helper): LOG.warning(_LW('Option "%(option)s" must be supported by command ' - '"%(command)s" to enable %(mode)s mode') % + '"%(command)s" to enable %(mode)s mode'), {'option': 'proxy', 'command': 'ip link add type vxlan', 'mode': 'VXLAN MCAST'})