Commit 71255840 authored by Lucas Carvalho's avatar Lucas Carvalho

Select method returns a file descriptor.

So it needs to write the file content in the correct path which must
be used by buildout.
parent 7d49bc97
......@@ -72,14 +72,14 @@ def download_network_cached(dir_url, cache_url, path, url, logger, md5sum=None):
logger.info('Downloading %s from network cache.' % file_name)
try:
nc = NetworkcacheClient(shacache=cache_url, shadir=dir_url)
file_content = nc.select(directory_key)
file_descriptor = nc.select(directory_key)
f = open(path, 'w+b')
try:
f.seek(0)
f.write(file_content)
for line in file_descriptor:
f.write(line)
finally:
f.close()
file_descriptor.close()
if not check_md5sum(path, md5sum):
logger.info('MD5 checksum mismatch downloading %s' % file_name)
......
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