Skip to content
Snippets Groups Projects
Commit bfa4a9aa authored by James Ennis's avatar James Ennis Committed by Jürg Billeter
Browse files

Import sandbox subclass when instantiating sandbox

Sandbox: Ensure that we only import the sandbox subclasses when instantiate a sandbox

This patch was required due to not being able to execute `bst` on
a Linux machine without Fuse or Bubblewrap available
parent a2ab8d7b
No related branches found
No related tags found
Loading
Pipeline #31250583 passed
......@@ -19,7 +19,7 @@ import os
import resource
from .._exceptions import PlatformError
from ..sandbox import SandboxChroot, SandboxDummy
from ..sandbox import SandboxDummy
from . import Platform
......
......@@ -23,7 +23,7 @@ import subprocess
from .. import _site
from .. import utils
from .._message import Message, MessageType
from ..sandbox import SandboxBwrap, SandboxDummy
from ..sandbox import SandboxDummy
from . import Platform
......@@ -48,6 +48,7 @@ class Linux(Platform):
if not self._local_sandbox_available():
return SandboxDummy(*args, **kwargs)
else:
from ..sandbox._sandboxbwrap import SandboxBwrap
# Inform the bubblewrap sandbox as to whether it can use user namespaces or not
kwargs['user_ns_available'] = self._user_ns_available
kwargs['die_with_parent_available'] = self._die_with_parent_available
......
......@@ -20,7 +20,6 @@
import os
from .._exceptions import PlatformError
from ..sandbox import SandboxChroot
from . import Platform
......@@ -39,6 +38,7 @@ class Unix(Platform):
raise PlatformError("Root privileges are required to run without bubblewrap.")
def create_sandbox(self, *args, **kwargs):
from ..sandbox._sandboxchroot import SandboxChroot
return SandboxChroot(*args, **kwargs)
def check_sandbox_config(self, config):
......
......@@ -18,7 +18,5 @@
# Tristan Maat <tristan.maat@codethink.co.uk>
from .sandbox import Sandbox, SandboxFlags
from ._sandboxchroot import SandboxChroot
from ._sandboxbwrap import SandboxBwrap
from ._sandboxremote import SandboxRemote
from ._sandboxdummy import SandboxDummy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment