diff --git a/swift/common/utils.py b/swift/common/utils.py index f67c6a8d3c..02e9cfe572 100644 --- a/swift/common/utils.py +++ b/swift/common/utils.py @@ -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 diff --git a/swift/obj/diskfile.py b/swift/obj/diskfile.py index 3bdef686a4..5e1e74fb2a 100644 --- a/swift/obj/diskfile.py +++ b/swift/obj/diskfile.py @@ -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