summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-02 11:46:46 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2018-10-04 09:12:20 +0100
commit59c92bda9a66c67b4a0c2bc8115918b93eda261c (patch)
tree0031d21da0b7499cef3574d22b21a309340a2d1f
parent3cf38c8e0a1828ed7ba6b5ec125c415a40da7f21 (diff)
downloadbuildstream-59c92bda9a66c67b4a0c2bc8115918b93eda261c.tar.gz
sandbox/_sandboxdummy.py: Take a reason for use
Since the SandboxDummy sandbox is only used in very specific circumstances and with good reason, this adjusts the SandboxDummy class to take a reason and to return it if `.run()` has to raise an exception because this is a dummy sandbox. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-rw-r--r--buildstream/sandbox/_sandboxdummy.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/buildstream/sandbox/_sandboxdummy.py b/buildstream/sandbox/_sandboxdummy.py
index 51239a4ea..29ff4bf69 100644
--- a/buildstream/sandbox/_sandboxdummy.py
+++ b/buildstream/sandbox/_sandboxdummy.py
@@ -23,6 +23,7 @@ from . import Sandbox
class SandboxDummy(Sandbox):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
+ self._reason = kwargs.get("dummy_reason", "no reason given")
def run(self, command, flags, *, cwd=None, env=None):
@@ -37,4 +38,4 @@ class SandboxDummy(Sandbox):
"'{}'".format(command[0]),
reason='missing-command')
- raise SandboxError("This platform does not support local builds")
+ raise SandboxError("This platform does not support local builds: {}".format(self._reason))