1
0
mirror of https://github.com/jumpserver/jumpserver.git synced 2025-05-04 22:27:06 +00:00

fix: Ansible could not initialize the preferred locale

This commit is contained in:
wangruidong 2025-03-19 11:19:37 +08:00 committed by w940853815
parent 4fdb049c9d
commit e68d5564c6
2 changed files with 4 additions and 2 deletions
apps
common/management/commands/services/services
ops/ansible/runners

View File

@ -13,8 +13,8 @@ class CeleryBaseService(BaseService):
def cmd(self):
print('\n- Start Celery as Distributed Task Queue: {}'.format(self.queue.capitalize()))
os.environ.setdefault('PYTHONPATH', settings.APPS_DIR)
os.environ.setdefault('LC_ALL', 'en_US.UTF-8')
os.environ.setdefault('LANG', 'en_US.UTF-8')
os.environ.setdefault('LC_ALL', 'C.UTF-8')
os.environ.setdefault('LANG', 'C.UTF-8')
os.environ.setdefault('PYTHONOPTIMIZE', '1')
if os.getuid() == 0:

View File

@ -18,6 +18,8 @@ class BaseRunner(WorkPostRunCleaner):
os.environ.setdefault('ANSIBLE_FORCE_COLOR', 'True')
os.environ.setdefault('ANSIBLE_CONFIG', ansible_config_path)
os.environ.setdefault('ANSIBLE_LIBRARY', ansible_modules_path)
os.environ.setdefault('LC_ALL', 'C.UTF-8')
os.environ.setdefault('LANG', 'C.UTF-8')
@classmethod
def kill_precess(cls, pid):