From 421f7cf14ca75c61d0cac8a3217ac04ce88f37a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= Date: Thu, 11 Oct 2018 13:57:21 -0400 Subject: _artifactcache: Fix crash in push_directory() without artifact server Fixes #708. --- buildstream/_artifactcache/cascache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 " + -- cgit v1.2.1