diff options
Diffstat (limited to 'buildstream/_artifactcache/artifactcache.py')
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index 2508e0b88..a7208e8f2 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -28,6 +28,7 @@ from ..exceptions import _ArtifactError from ..element import _KeyStrength from .._ostree import OSTreeError +from .pushreceive import check_push_connection from .pushreceive import push as push_artifact from .pushreceive import PushException @@ -67,6 +68,15 @@ class ArtifactCache(): self.__offline = False + def preflight(self): + if self.can_push() and not self.context.artifact_push.startswith("/"): + try: + check_push_connection(self.context.artifact_push, + self.context.artifact_push_port) + except PushException as e: + raise _ArtifactError("BuildStream will be unable to push artifacts " + "to the shared cache: {}".format(e)) + # contains(): # # Check whether the artifact for the specified Element is already available |