Commit f352bac9 authored by Łukasz Nowak's avatar Łukasz Nowak

Use URLs instead of filenames.

URLs are important to being read, not files.
parent f051d0be
...@@ -68,9 +68,9 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None): ...@@ -68,9 +68,9 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
directory_key = get_directory_key(url) directory_key = get_directory_key(url)
file_name = os.path.basename(url) url = os.path.basename(url)
logger.info('Downloading %s from network cache.' % file_name) logger.info('Downloading %s from network cache.' % url)
try: try:
nc = NetworkcacheClient(shacache=cache_url, shadir=dir_url) nc = NetworkcacheClient(shacache=cache_url, shadir=dir_url)
file_descriptor = nc.select(directory_key) file_descriptor = nc.select(directory_key)
...@@ -84,12 +84,12 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None): ...@@ -84,12 +84,12 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
file_descriptor.close() file_descriptor.close()
if not check_md5sum(path, md5sum): if not check_md5sum(path, md5sum):
logger.info('MD5 checksum mismatch downloading %s' % file_name) logger.info('MD5 checksum mismatch downloading %s' % url)
return False return False
except (IOError, DirectoryNotFound), e: except (IOError, DirectoryNotFound), e:
logger.info('Failed to download from network cache %s: %s' % \ logger.info('Failed to download from network cache %s: %s' % \
(file_name, str(e))) (url, str(e)))
return False return False
return True return True
......
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