]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
linuxbridge: Use lazy logging interpolation
authorAngus Lees <gus@inodes.org>
Mon, 22 Dec 2014 04:40:32 +0000 (15:40 +1100)
committerAngus Lees <gus@inodes.org>
Mon, 22 Dec 2014 06:12:54 +0000 (17:12 +1100)
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

neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py

index f4af61a764e7c588ac25743ccdf03300af57f77e..7507d404c0ffeff040078a96777722b673191bbd 100755 (executable)
@@ -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'})