Commit 9f88d607 authored by James Ennis's avatar James Ennis
Browse files

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 5c286bf0
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import os
import resource

from .._exceptions import PlatformError
from ..sandbox import SandboxChroot, SandboxDummy
from ..sandbox import DummySandbox

from . import Platform

+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ from .. import _site
from .. import utils
from .._artifactcache.cascache import CASCache
from .._message import Message, MessageType
from ..sandbox import SandboxBwrap, SandboxDummy
from ..sandbox import DummySandbox

from . import Platform

@@ -52,6 +52,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
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import os

from .._artifactcache.cascache import CASCache
from .._exceptions import PlatformError
from ..sandbox import SandboxChroot

from . import Platform

@@ -41,4 +40,5 @@ class Unix(Platform):
        return self._artifact_cache

    def create_sandbox(self, *args, **kwargs):
        from ..sandbox._sandboxchroot import SandboxChroot
        return SandboxChroot(*args, **kwargs)
+0 −2
Original line number Diff line number Diff line
@@ -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