diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-14 19:45:40 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-04-14 19:45:40 +0900 |
commit | d603051e4ac14ccb7413861963eccffd21fcdf34 (patch) | |
tree | bc0c01d4e500c4a84f1fe9373816c4c7b46135c7 | |
parent | 1094d62bd1d985bb646c5873c197c33ca4560ddd (diff) | |
download | buildstream-d603051e4ac14ccb7413861963eccffd21fcdf34.tar.gz |
_artifactcache/tarcache.py: Extracting a missing artifact is a bug
Raise an assertion here, not an ArtifactError.
-rw-r--r-- | buildstream/_artifactcache/tarcache.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/_artifactcache/tarcache.py b/buildstream/_artifactcache/tarcache.py index a53b22162..10ae9d008 100644 --- a/buildstream/_artifactcache/tarcache.py +++ b/buildstream/_artifactcache/tarcache.py @@ -62,8 +62,8 @@ class TarCache(ArtifactCache): fullname = self.get_artifact_fullname(element, key) path = _tarpath(element, key) - if not os.path.isfile(os.path.join(self.tardir, path)): - raise ArtifactError("Artifact missing for {}".format(fullname)) + # Extracting a nonexistent artifact is a bug + assert os.path.isfile(os.path.join(self.tardir, path)), "Artifact missing for {}".format(fullname) # If the destination already exists, the artifact has been extracted dest = os.path.join(self.extractdir, fullname) |