From: Angus Lees Date: Mon, 22 Dec 2014 04:40:03 +0000 (+1100) Subject: embrane: Use lazy logging interpolation X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=15581431c1a30a30f33860e0f895b7973d830e48;p=openstack-build%2Fneutron-build.git embrane: 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 embrane via a pylint test. Other occurrences are addressed elsewhere. Change-Id: Iabceb8c7d32111ae97d1200fbd25681e317f7bb7 Partial-Bug: #1404788 --- diff --git a/neutron/plugins/embrane/agent/dispatcher.py b/neutron/plugins/embrane/agent/dispatcher.py index 9af511f79..2ce7db1b0 100644 --- a/neutron/plugins/embrane/agent/dispatcher.py +++ b/neutron/plugins/embrane/agent/dispatcher.py @@ -108,10 +108,10 @@ class Dispatcher(object): h_exc.BrokenInterface, h_exc.DvaCreationFailed, h_exc.DvaCreationPending, h_exc.BrokenDva, h_exc.ConfigurationFailed) as ex: - LOG.warning(p_con.error_map[type(ex)] % ex.message) + LOG.warning(p_con.error_map[type(ex)], ex.message) transient_state = p_con.Status.ERROR except h_exc.DvaDeleteFailed as ex: - LOG.warning(p_con.error_map[type(ex)] % ex.message) + LOG.warning(p_con.error_map[type(ex)], ex.message) transient_state = p_con.Status.DELETED finally: # if the returned transient state is None, no operations