Commit 41c59a92 authored by Łukasz Nowak's avatar Łukasz Nowak

Style fixes.

Keep same ordering and simplify conditions.
parent 136ba144
......@@ -62,8 +62,7 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
if not LIBNETWORKCACHE_ENABLED:
return False
if cache_url in (None, '',):
# Not able to use network cache
if not(dir_url and cache_url):
return False
if md5sum is None:
md5sum = _get_md5_from_url(url)
......@@ -95,14 +94,12 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
return True
def upload_network_cached(cache_url, dir_url, external_url, path, logger):
def upload_network_cached(dir_url, cache_url, external_url, path, logger):
"""Upload file to a network cache server"""
if not LIBNETWORKCACHE_ENABLED:
return False
if cache_url in [None, ''] or dir_url in [None, '']:
logger.debug(
'Upload cache ignored, shacache or shadir was not provided!')
if not (dir_url and cache_url):
return False
file_name = external_url.split('/')[-1].split('#')[0].split('?')[0]
......
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