replace string format arguments with function parameters

There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: I456f411ad6ca46a8c8de442c74c18276faca920e
Partial-Bug: #1321274
This commit is contained in:
Christian Berendt 2014-05-20 16:46:01 +02:00
parent c4d2d95eb3
commit caababc62d
2 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,7 @@ class FixedIntervalLoopingCall(LoopingCallBase):
break
delay = interval - timeutils.delta_seconds(start, end)
if delay <= 0:
LOG.warn(_('task run outlasted interval by %s sec') %
LOG.warn(_('task run outlasted interval by %s sec'),
-delay)
greenthread.sleep(delay if delay > 0 else 0)
except LoopingCallDone as e:

View File

@ -118,7 +118,8 @@ class VMwareDriverException(Exception):
# log the issue and the kwargs
LOG.exception(_('Exception in string format operation'))
for name, value in six.iteritems(kwargs):
LOG.error("%s: %s" % (name, value))
LOG.error("%(name)s: %(value)s",
{'name': name, 'value': value})
# at least get the core message out if something happened
message = self.msg_fmt