Merge "replace string format arguments with function parameters"

This commit is contained in:
Jenkins 2014-06-12 18:52:43 +00:00 committed by Gerrit Code Review
commit de60b028ef
2 changed files with 10 additions and 7 deletions

View File

@ -556,8 +556,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):
@ -1575,7 +1576,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

View File

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