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): ...@@ -213,7 +213,10 @@ class Software(object):
finally: finally:
tar.close() tar.close()
elif force_binary_cache: 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) self.logger.error(message)
raise BuildoutFailedError(message) raise BuildoutFailedError(message)
else: else:
......
...@@ -93,13 +93,16 @@ def download_network_cached(cache_url, dir_url, software_url, software_root, ...@@ -93,13 +93,16 @@ def download_network_cached(cache_url, dir_url, software_url, software_root,
return True if download succeeded. return True if download succeeded.
""" """
if not LIBNETWORKCACHE_ENABLED: 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): 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: for url in download_from_binary_cache_url_blacklist:
if software_url.startswith(url): if software_url.startswith(url):
logger.warning('URL %s is blacklisted', url)
return False return False
try: 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