nanonyme commented on a change in pull request #1436:
URL: https://github.com/apache/buildstream/pull/1436#discussion_r810323157
##########
File path: src/buildstream/_platform/platform.py
##########
@@ -159,44 +161,16 @@ def get_host_arch():
# (Sandbox) A sandbox
#
def create_sandbox(self, *args, **kwargs): # pylint: disable=method-hidden
- raise ImplError("Platform {platform} does not implement
create_sandbox()".format(platform=type(self).__name__))
-
- def check_sandbox_config(self, config): # pylint: disable=method-hidden
- raise ImplError(
- "Platform {platform} does not implement
check_sandbox_config()".format(platform=type(self).__name__)
- )
-
- # Buildbox run sandbox methods
- def _check_sandbox_config_buildboxrun(self, config):
- from ..sandbox._sandboxbuildboxrun import SandboxBuildBoxRun #
pylint: disable=cyclic-import
-
- SandboxBuildBoxRun.check_sandbox_config(self, config)
-
- @staticmethod
- def _create_buildboxrun_sandbox(*args, **kwargs):
from ..sandbox._sandboxbuildboxrun import SandboxBuildBoxRun #
pylint: disable=cyclic-import
- return SandboxBuildBoxRun(*args, **kwargs)
-
- def _setup_buildboxrun_sandbox(self):
- from ..sandbox._sandboxbuildboxrun import SandboxBuildBoxRun #
pylint: disable=cyclic-import
-
- self._check_sandbox(SandboxBuildBoxRun)
- self.check_sandbox_config = self._check_sandbox_config_buildboxrun
- self.create_sandbox = self._create_buildboxrun_sandbox
- return True
-
- # Dummy sandbox methods
- @staticmethod
- def _check_dummy_sandbox_config(config):
- pass
+ if self.dummy_reasons:
+ dummy_reasons = " and ".join(self.dummy_reasons)
+ else:
+ try:
+ SandboxBuildBoxRun.check_sandbox_config(kwargs['config'])
+ return SandboxBuildBoxRun(*args, **kwargs)
+ except SandboxError as e:
+ dummy_reasons = e.message
Review comment:
Well, I looked into the inheritance hierarchy and it looked like it
really cannot ever be e.message. Unless you have some class which *inherits*
SandboxError and adds message as member. But SandboxError and its base classes
do not do that so linter was right. Perhaps it's a bug and they *should* set it
as member.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]