Commit a05a455e authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

slapos/grid: improve logging regarding networkcache

parent a105879b
......@@ -213,7 +213,10 @@ class Software(object):
finally:
tar.close()
elif force_binary_cache:
message = 'Binary cache forced for %r, but failed to download, will retry again' % (self.url,)
if os.path.exists(self.software_path):
message = 'Binary cache forced for %r, but directory %s already exists, will retry again' % (self.url, self.software_path)
else:
message = 'Binary cache forced for %r, but failed to download, will retry again' % (self.url,)
self.logger.error(message)
raise BuildoutFailedError(message)
else:
......
......@@ -93,13 +93,16 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
return True if download succeeded.
"""
if not LIBNETWORKCACHE_ENABLED:
return False
logger.warning('LIBNETWORKCACHE_ENABLED is false')
return False
if not(cache_url and dir_url and software_url and software_root):
return False
logger.warning('networkcache badly configured')
return False
for url in download_from_binary_cache_url_blacklist:
if software_url.startswith(url):
logger.warning('URL %s is blacklisted', url)
return False
try:
......
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