mirror of https://github.com/jumpserver/jumpserver
perf: add compatibility for macOS environment
parent
d9754496d0
commit
4a49bde1f0
|
@ -39,8 +39,7 @@ ARG TOOLS=" \
|
||||||
nmap \
|
nmap \
|
||||||
telnet \
|
telnet \
|
||||||
vim \
|
vim \
|
||||||
wget \
|
wget"
|
||||||
bubblewrap"
|
|
||||||
|
|
||||||
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
|
||||||
|
|
|
@ -417,3 +417,7 @@ def distinct(seq, key=None):
|
||||||
seen.add(k)
|
seen.add(k)
|
||||||
result.append(item)
|
result.append(item)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def is_macos():
|
||||||
|
return platform.system() == 'Darwin'
|
||||||
|
|
|
@ -5,6 +5,7 @@ import uuid
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils._os import safe_join
|
from django.utils._os import safe_join
|
||||||
|
|
||||||
|
from common.utils import is_macos
|
||||||
from .callback import DefaultCallback
|
from .callback import DefaultCallback
|
||||||
from .exception import CommandInBlackListException
|
from .exception import CommandInBlackListException
|
||||||
from .interface import interface
|
from .interface import interface
|
||||||
|
@ -104,7 +105,7 @@ class PlaybookRunner:
|
||||||
shutil.rmtree(private_env)
|
shutil.rmtree(private_env)
|
||||||
|
|
||||||
kwargs = dict(kwargs)
|
kwargs = dict(kwargs)
|
||||||
if self.isolate:
|
if self.isolate and not is_macos:
|
||||||
kwargs['process_isolation'] = True
|
kwargs['process_isolation'] = True
|
||||||
kwargs['process_isolation_executable'] = 'bwrap'
|
kwargs['process_isolation_executable'] = 'bwrap'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue