Commit 5d5ebff6 authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify detection of libnetworkcache.

parent 4a184955
......@@ -40,6 +40,12 @@ import zc.buildout
import zc.buildout.download
import zc.buildout.easy_install
try:
import slapos.libnetworkcache
except ImportError:
LIBNETWORKCACHE_ENABLED = False
else:
LIBNETWORKCACHE_ENABLED = True
realpath = zc.buildout.easy_install.realpath
......@@ -345,11 +351,7 @@ class Buildout(UserDict.DictMixin):
# Get a base working set for our distributions that corresponds to the
# stated desires in the configuration.
distributions = ['setuptools', 'zc.buildout']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
if LIBNETWORKCACHE_ENABLED:
distributions.append('slapos.libnetworkcache')
if options.get('offline') == 'true':
ws = zc.buildout.easy_install.working_set(
......@@ -375,11 +377,7 @@ class Buildout(UserDict.DictMixin):
# Now copy buildout and setuptools eggs, and record destination eggs:
entries = []
copy_list = ['setuptools', 'zc.buildout']
try:
import slapos.libnetworkcache
except ImportError:
pass
else:
if LIBNETWORKCACHE_ENABLED:
copy_list.append('slapos.libnetworkcache')
for name in copy_list:
r = pkg_resources.Requirement.parse(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