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
This commit is contained in:
Angus Lees 2014-12-22 15:40:03 +11:00
parent 65dd2e510f
commit 15581431c1

View File

@ -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