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: I1c2a4f43463932e85c75d576241d0c0455c38492
This commit is contained in:
parent
fd54207d3f
commit
ac2dbb0f1f
@ -540,8 +540,9 @@ def drop_buffer_cache(fd, offset, length):
|
||||
ret = _posix_fadvise(fd, ctypes.c_uint64(offset),
|
||||
ctypes.c_uint64(length), 4)
|
||||
if ret != 0:
|
||||
logging.warn("posix_fadvise64(%s, %s, %s, 4) -> %s"
|
||||
% (fd, offset, length, ret))
|
||||
logging.warn("posix_fadvise64(%(fd)s, %(offset)s, %(length)s, 4) "
|
||||
"-> %(ret)s", {'fd': fd, 'offset': offset,
|
||||
'length': length, 'ret': ret})
|
||||
|
||||
|
||||
def normalize_timestamp(timestamp):
|
||||
@ -1546,7 +1547,7 @@ def item_from_env(env, item_name, allow_none=False):
|
||||
"""
|
||||
item = env.get(item_name, None)
|
||||
if item is None and not allow_none:
|
||||
logging.error("ERROR: %s could not be found in env!" % item_name)
|
||||
logging.error("ERROR: %s could not be found in env!", item_name)
|
||||
return item
|
||||
|
||||
|
||||
|
@ -233,8 +233,9 @@ def hash_suffix(path, reclaim_age):
|
||||
device_path = dirname(objects_path)
|
||||
quar_path = quarantine_renamer(device_path, hsh_path)
|
||||
logging.exception(
|
||||
_('Quarantined %s to %s because it is not a directory') %
|
||||
(hsh_path, quar_path))
|
||||
_('Quarantined %(hsh_path)s to %(quar_path)s because '
|
||||
'it is not a directory'), {'hsh_path': hsh_path,
|
||||
'quar_path': quar_path})
|
||||
continue
|
||||
raise
|
||||
if not files:
|
||||
@ -543,8 +544,9 @@ class DiskFileManager(object):
|
||||
if err.errno == errno.ENOTDIR:
|
||||
quar_path = quarantine_renamer(dev_path, object_path)
|
||||
logging.exception(
|
||||
_('Quarantined %s to %s because it is not a '
|
||||
'directory') % (object_path, quar_path))
|
||||
_('Quarantined %(object_path)s to %(quar_path)s because '
|
||||
'it is not a directory'), {'object_path': object_path,
|
||||
'quar_path': quar_path})
|
||||
raise DiskFileNotExist()
|
||||
if err.errno != errno.ENOENT:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user