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