Skip to content
Snippets Groups Projects
Commit 54e27fb3 authored by James Ennis's avatar James Ennis Committed by Phillip Smyth
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 c5dd2cb6
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ import os
import resource
from .._exceptions import PlatformError
from ..sandbox import SandboxChroot, SandboxDummy
from ..sandbox import SandboxDummy
from . import Platform
......
......@@ -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 SandboxDummy
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
......
......@@ -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)
......@@ -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.
Finish editing this message first!
Please register or to comment