summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-10-11 13:57:21 -0400
committerJürg Billeter <j@bitron.ch>2018-10-11 13:57:21 -0400
commit421f7cf14ca75c61d0cac8a3217ac04ce88f37a4 (patch)
tree88c51692beb33dde932f4c740a84ab759fc67590
parenta0712eadd423c2bc98f195d972030455d65a81ae (diff)
downloadbuildstream-juerg/remote-config.tar.gz
_artifactcache: Fix crash in push_directory() without artifact serverjuerg/remote-config
Fixes #708.
-rw-r--r--buildstream/_artifactcache/cascache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 3e63608be..ed6d58821 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -365,7 +365,10 @@ class CASCache(ArtifactCache):
Raises: ArtifactError if no push remotes are configured.
"""
- push_remotes = [r for r in self._remotes[project] if r.spec.push]
+ if self._has_push_remotes:
+ push_remotes = [r for r in self._remotes[project] if r.spec.push]
+ else:
+ push_remotes = []
if not push_remotes:
raise ArtifactError("CASCache: push_directory was called, but no remote artifact " +