Commit 9cb0c3d8 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

networkcache: remove not lazy formatting in logger

Leave string interpolation to the logging method
parent d716c541
......@@ -108,7 +108,7 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
logger.warning('Incompatible version of networkcache, not using it.')
return False
logger.info('Downloading %s binary from network cache.' % software_url)
logger.info('Downloading %s binary from network cache.', software_url)
try:
file_descriptor = None
machine_info = machine_info_tuple()
......@@ -129,8 +129,8 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
file_descriptor.close()
return True
except (IOError, DirectoryNotFound) as e:
logger.info('Failed to download from network cache %s: %s' % \
(software_url, str(e)))
logger.info(
'Failed to download from network cache %s: %s', software_url, e)
return False
......@@ -147,7 +147,7 @@ def upload_network_cached(software_root, software_url, cached_key,
and cache_url and dir_url):
return False
logger.info('Uploading %s binary into network cache.' % software_url)
logger.info('Uploading %s binary into network cache.', software_url)
# YXU: "file" and "urlmd5" should be removed when server side is ready
kw = dict(
......@@ -191,7 +191,7 @@ def upload_network_cached(software_root, software_url, cached_key,
try:
return nc.upload_generic(f, cached_key, **kw)
except (IOError, UploadError) as e:
logger.info('Failed to upload file. %s' % str(e))
logger.info('Failed to upload file. %s', e)
return False
finally:
f.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment