diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-14 08:08:35 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-08-14 08:08:35 +0100 |
commit | 2a47d489575136c8dd12e99c2266f3459ba77a52 (patch) | |
tree | d2a861ecb7e749adbc25172c4a164566bc543fc8 /src/buildstream/sandbox/_sandboxbuildbox.py | |
parent | 18fe6a4b01e7abe4fa49a49d4c8ce481a3c1d09e (diff) | |
download | buildstream-2a47d489575136c8dd12e99c2266f3459ba77a52.tar.gz |
sandbox/_sandbox*.py: Ensure missing-command is a SandboxCommandError
So that, should a sandbox be missing a command such as `sh`, we cache
failures to build, ensure that each sandbox which checks for the command
raises SandboxCommandError instead of SandboxError.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'src/buildstream/sandbox/_sandboxbuildbox.py')
-rw-r--r-- | src/buildstream/sandbox/_sandboxbuildbox.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildstream/sandbox/_sandboxbuildbox.py b/src/buildstream/sandbox/_sandboxbuildbox.py index 417d2224d..99c7322a3 100644 --- a/src/buildstream/sandbox/_sandboxbuildbox.py +++ b/src/buildstream/sandbox/_sandboxbuildbox.py @@ -23,7 +23,7 @@ from contextlib import ExitStack import psutil from .. import utils, _signals, ProgramNotFoundError -from . import Sandbox, SandboxFlags +from . import Sandbox, SandboxFlags, SandboxCommandError from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2 from ..storage._casbaseddirectory import CasBasedDirectory from .._exceptions import SandboxError @@ -73,9 +73,9 @@ class SandboxBuildBox(Sandbox): scratch_directory = self._get_scratch_directory() if not self._has_command(command[0], env): - raise SandboxError("Staged artifacts do not provide command " - "'{}'".format(command[0]), - reason='missing-command') + raise SandboxCommandError("Staged artifacts do not provide command " + "'{}'".format(command[0]), + reason='missing-command') # Grab the full path of the buildbox binary try: |