summaryrefslogtreecommitdiff
path: root/src/buildstream/_basecache.py
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-05-29 16:35:57 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-05 14:41:48 +0000
commit216e17384575e67ee1c70209d97f666672eb31bd (patch)
treeb8ca84b006e4ff8c06080fb28419ca22b9a005ec /src/buildstream/_basecache.py
parenteda3d28249a2a21bf09bcc7340d324888ba6584d (diff)
downloadbuildstream-216e17384575e67ee1c70209d97f666672eb31bd.tar.gz
Improve legacy artifact remote handling
This creates a new ArtifactRemote class, derived from CASRemote that extends initialisation to check for an artifact service. This drops the remote early rather than raising an error on method not found each time it tries to use it. Fixes #1025
Diffstat (limited to 'src/buildstream/_basecache.py')
-rw-r--r--src/buildstream/_basecache.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/buildstream/_basecache.py b/src/buildstream/_basecache.py
index 68654b2a0..ef9414787 100644
--- a/src/buildstream/_basecache.py
+++ b/src/buildstream/_basecache.py
@@ -37,6 +37,7 @@ class BaseCache():
spec_name = None
spec_error = None
config_node_name = None
+ remote_class = CASRemote
def __init__(self, context):
self.context = context
@@ -163,18 +164,19 @@ class BaseCache():
q = multiprocessing.Queue()
for remote_spec in remote_specs:
- error = CASRemote.check_remote(remote_spec, q)
+ error = self.remote_class.check_remote(remote_spec, q)
if error and on_failure:
on_failure(remote_spec.url, error)
+ continue
elif error:
raise self.spec_error(error) # pylint: disable=not-callable
- else:
- self._has_fetch_remotes = True
- if remote_spec.push:
- self._has_push_remotes = True
- remotes[remote_spec.url] = CASRemote(remote_spec)
+ self._has_fetch_remotes = True
+ if remote_spec.push:
+ self._has_push_remotes = True
+
+ remotes[remote_spec.url] = self.remote_class(remote_spec)
for project in self.context.get_projects():
remote_specs = self.global_remote_specs