Browse Source

perf: 添加LC_ALL环境变量C.UTF-8 解决ansible无法初始化首选语言环境问题 (#12530)

Co-authored-by: feng <1304903146@qq.com>
pull/12533/head
fit2bot 11 months ago committed by GitHub
parent
commit
1275087f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/common/management/commands/services/services/celery_base.py

1
apps/common/management/commands/services/services/celery_base.py

@ -14,6 +14,7 @@ class CeleryBaseService(BaseService):
print('\n- Start Celery as Distributed Task Queue: {}'.format(self.queue.capitalize()))
ansible_config_path = os.path.join(settings.APPS_DIR, 'ops', 'ansible', 'ansible.cfg')
ansible_modules_path = os.path.join(settings.APPS_DIR, 'ops', 'ansible', 'modules')
os.environ.setdefault('LC_ALL', 'C.UTF-8')
os.environ.setdefault('PYTHONOPTIMIZE', '1')
os.environ.setdefault('ANSIBLE_FORCE_COLOR', 'True')
os.environ.setdefault('ANSIBLE_CONFIG', ansible_config_path)

Loading…
Cancel
Save