Commit 56b871dc authored by Łukasz Nowak's avatar Łukasz Nowak

Fix lazy coupling.

If slapos.libnetworkache is not available, setup environment in no-op way.
parent 779d8687
......@@ -336,7 +336,14 @@ class Buildout(UserDict.DictMixin):
os.chdir(options['directory'])
if LIBNETWORKCACHE_ENABLED:
if not LIBNETWORKCACHE_ENABLED:
self._logger.warning('Networkache disabled, no '
'slapos.libnetworkache available.')
self.download_cache_url = None
self.download_dir_url = None
self.upload_cache_url = None
self.upload_dir_url = None
else:
# support networkcache
networkcache_section_name = options.get('networkcache-section')
if networkcache_section_name:
......@@ -360,7 +367,8 @@ class Buildout(UserDict.DictMixin):
options['__networkcache__upload-cache-url'] = self.upload_cache_url
options['__networkcache__upload-dir-url'] = self.upload_dir_url
else:
self._logger.warning('Networkcache functionality not enabled.')
self._logger.warning('Networkcache functionality not enabled.'
'In order to activate use networkcache-section.')
self.download_cache_url = None
self.download_dir_url = None
self.upload_cache_url = None
......
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