diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-02 11:46:46 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2018-10-03 17:02:09 +0100 |
commit | d60800c9f015e671bff567055f763d5912366058 (patch) | |
tree | 800c17425c01691c8e38e78721c1c28a50aaba1d | |
parent | 3e5ff5a9667917d0200f4e9bbb3e61093fb69368 (diff) | |
download | buildstream-d60800c9f015e671bff567055f763d5912366058.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.py | 3 |
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)) |