summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-10 14:01:31 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-02-11 16:04:44 +0000
commit4923dac4c5b67dc447cc562a4f3ca8380eafc0b2 (patch)
treea08533ed605b191ac63a52061d4cb6d6071c9fd5
parent6db681a663353fd38bd192036b5001c631bb366a (diff)
downloadmorph-4923dac4c5b67dc447cc562a4f3ca8380eafc0b2.tar.gz
builder: Fix some places that assume there is always a remote cache
-rw-r--r--morphlib/builder.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/morphlib/builder.py b/morphlib/builder.py
index 4b659984..00955abe 100644
--- a/morphlib/builder.py
+++ b/morphlib/builder.py
@@ -476,11 +476,14 @@ class StratumBuilder(BuilderBase):
constituent_sources = {d.source for d in constituents}
# the only reason the StratumBuilder has to download chunks is to
- # check for overlap now that strata are lists of chunks
+ # check for overlap now that strata are lists of chunks. If there
+ # is no remote artifact cache, we assume they're all cached
+ # locally.
with self.build_watch('check-chunks'):
- self.remote_artifact_cache.get_artifacts_for_sources(
- constituent_sources, self.local_artifact_cache,
- status_cb=self.app.status)
+ if self.remote_artifact_cache:
+ self.remote_artifact_cache.get_artifacts_for_sources(
+ constituent_sources, self.local_artifact_cache,
+ status_cb=self.app.status)
with self.build_watch('create-chunk-list'):
lac = self.local_artifact_cache
@@ -572,9 +575,10 @@ class SystemBuilder(BuilderBase): # pragma: no cover
self.source.dependencies)
# download the stratum and chunk artifacts if necessary
- self.remote_artifact_cache.get_artifacts_for_sources(
- dep_sources, self.local_artifact_cache,
- status_cb=self.app.status)
+ if self.remote_artifact_cache:
+ self.remote_artifact_cache.get_artifacts_for_sources(
+ dep_sources, self.local_artifact_cache,
+ status_cb=self.app.status)
# unpack it from the local artifact cache
for stratum_artifact in self.source.dependencies: