mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-10-27 03:21:57 -06:00
Additional Ansible Changes
This commit is contained in:
25
Data/Agent/sitecustomize.py
Normal file
25
Data/Agent/sitecustomize.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Borealis controller shims executed on interpreter startup."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import multiprocessing
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
multiprocessing.set_start_method('spawn')
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
mp_ctx = multiprocessing.get_context('fork')
|
||||
except ValueError:
|
||||
try:
|
||||
import ansible.utils.multiprocessing as ansible_mp # type: ignore
|
||||
except Exception:
|
||||
log.debug('Borealis sitecustomize: ansible multiprocessing module missing; skipping fork patch')
|
||||
else:
|
||||
ansible_mp.context = multiprocessing.get_context('spawn')
|
||||
log.debug('Borealis sitecustomize: patched ansible multiprocessing context to spawn')
|
||||
else:
|
||||
log.debug('Borealis sitecustomize: fork context available (%s)', mp_ctx)
|
||||
Reference in New Issue
Block a user