From 4a5a8aab0f6a451642b459cdc510edb4e36a9858 Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Mon, 22 Dec 2014 15:40:32 +1100 Subject: [PATCH] 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 --- .../plugins/linuxbridge/agent/linuxbridge_neutron_agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'}) -- 2.45.2