Commit 7becb258 authored by Lucas Carvalho's avatar Lucas Carvalho

We do not need to keep a log under buildout.

Removed useless method which should not exist.
parent 1b59eb89
...@@ -33,38 +33,6 @@ def _get_md5_from_url(url): ...@@ -33,38 +33,6 @@ def _get_md5_from_url(url):
return None return None
def _update_network_cached_log(path, url):
"""Update the networkcached.log file.
Adding the last key and URL which has been retrieved from shacache server.
"""
f = open(path, 'r')
try:
key = hashlib.sha512(f.read()).hexdigest()
finally:
f.close()
# Keep the log
map_path = os.path.join(os.environ.get('PWD'), '.networkcached.log')
mode = 'r+'
if not os.path.exists(map_path):
mode = 'w+'
f = open(map_path, mode)
try:
flag = False
for line in f:
if url in line:
flag = True
break
if not flag:
f.seek(0, 2)
f.write('%s %s\n' % (key, url))
f.truncate(f.tell())
finally:
f.close()
def select_sha512sum_from_shadir(sha_dir, url, logger): def select_sha512sum_from_shadir(sha_dir, url, logger):
"""It must return the sha512sum if exists on selected directory. """ """It must return the sha512sum if exists on selected directory. """
# On buildout.cfg the option sha-dir is the complete link including the # On buildout.cfg the option sha-dir is the complete link including the
...@@ -145,7 +113,6 @@ def upload_network_cached(sha_cache, sha_dir, external_url, path, logger): ...@@ -145,7 +113,6 @@ def upload_network_cached(sha_cache, sha_dir, external_url, path, logger):
nc = NetworkcacheClient(shacache=sha_cache, nc = NetworkcacheClient(shacache=sha_cache,
shadir=sha_dir_without_directory_key) shadir=sha_dir_without_directory_key)
data = nc.upload(f, directory_key, **kw) data = nc.upload(f, directory_key, **kw)
_update_network_cached_log(path, external_url)
except (IOError, UploadError), e: except (IOError, UploadError), e:
logger.info('Fail to upload file. %s' % \ logger.info('Fail to upload file. %s' % \
(str(e))) (str(e)))
......
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