summaryrefslogtreecommitdiff
path: root/buildstream/_artifactcache/cascache.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_artifactcache/cascache.py')
-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 " +