summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-09-26 08:52:23 +0100
committerJürg Billeter <j@bitron.ch>2018-09-27 10:18:03 +0100
commitb99a67405d0240557bfb29528606b8c23609a460 (patch)
tree590205b2fba0c621da23ab439446a0e17787552f
parentf5f3cb7ca78c6ffcc64ff4333108c6e8e103f3fa (diff)
downloadbuildstream-b99a67405d0240557bfb29528606b8c23609a460.tar.gz
element.py: Add __use_remote_execution() helper method
-rw-r--r--buildstream/element.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 74deda384..55e402a95 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -2114,6 +2114,14 @@ class Element(Plugin):
return self.__tainted
+ # __use_remote_execution():
+ #
+ # Returns True if remote execution is configured and the element plugin
+ # supports it.
+ #
+ def __use_remote_execution(self):
+ return self.__remote_execution_url and self.BST_VIRTUAL_DIRECTORY
+
# __sandbox():
#
# A context manager to prepare a Sandbox object at the specified directory,
@@ -2135,9 +2143,7 @@ class Element(Plugin):
project = self._get_project()
platform = Platform.get_platform()
- if (directory is not None and
- self.__remote_execution_url and
- self.BST_VIRTUAL_DIRECTORY):
+ if directory is not None and self.__use_remote_execution():
self.info("Using a remote sandbox for artifact {} with directory '{}'".format(self.name, directory))