summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-14 19:45:09 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-04-14 19:45:09 +0900
commit1094d62bd1d985bb646c5873c197c33ca4560ddd (patch)
treeee7b345cd1988747b1aef4a8b14513ece545d702
parent476526fc10046387802899d40f8c4562164990f9 (diff)
downloadbuildstream-1094d62bd1d985bb646c5873c197c33ca4560ddd.tar.gz
_artifactcache/ostreecache.py: Extracting a missing artifact is a bug
Raise an assertion here, not an ArtifactError.
-rw-r--r--buildstream/_artifactcache/ostreecache.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/ostreecache.py b/buildstream/_artifactcache/ostreecache.py
index 182b3f9c6..39e7efb34 100644
--- a/buildstream/_artifactcache/ostreecache.py
+++ b/buildstream/_artifactcache/ostreecache.py
@@ -101,8 +101,8 @@ class OSTreeCache(ArtifactCache):
# resolve ref to checksum
rev = _ostree.checksum(self.repo, ref)
- if not rev:
- raise ArtifactError("Artifact missing for {}".format(ref))
+ # Extracting a nonexistent artifact is a bug
+ assert rev, "Artifact missing for {}".format(ref)
dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, rev)
if os.path.isdir(dest):