Commit 5e185ed1 authored by knownexus's avatar knownexus
Browse files

Add FUSE check to linux.py

This needed to be implemented as Windows WSL
Does not currently support FUSE
parent a4928a91
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#  Authors:
#        Tristan Maat <tristan.maat@codethink.co.uk>

import os
import subprocess

from .. import _site
@@ -35,7 +36,11 @@ class Linux(Platform):
        super().__init__(context)

        self._die_with_parent_available = _site.check_bwrap_version(0, 1, 8)

        if self._local_sandbox_available():
            self._user_ns_available = self._check_user_ns_available(context)
        else:
            self._user_ns_available = False
        self._artifact_cache = CASCache(context, enable_push=self._user_ns_available)

    @property
@@ -51,7 +56,11 @@ class Linux(Platform):
    ################################################
    #              Private Methods                 #
    ################################################
    def _local_sandbox_available(self):
        return os.path.exists(utils.get_host_tool('bwrap')) and os.path.exists('/dev/fuse')

    def _check_user_ns_available(self, context):

        # Here, lets check if bwrap is able to create user namespaces,
        # issue a warning if it's not available, and save the state
        # locally so that we can inform the sandbox to not try it