compass-core/compass/utils/celeryconfig_wrapper.py
xiaodongwang f009619f9a fix python tests depending on /etc/compass/seting file bug.
Change-Id: Ia9aff7654e5720942a78acc0334e782e5022b4da
2014-01-29 00:33:21 -08:00

25 lines
606 B
Python

"""celeryconfig wrapper."""
import logging
import os.path
from compass.utils import setting_wrapper as setting
CELERY_RESULT_BACKEND = 'amqp://'
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_IMPORTS = ('compass.tasks.tasks',)
if setting.CELERYCONFIG_FILE:
CELERY_CONFIG = os.path.join(setting.CELERYCONFIG_DIR,
setting.CELERYCONFIG_FILE)
try:
logging.info('load celery config from %s', CELERY_CONFIG)
execfile(CELERY_CONFIG, globals(), locals())
except Exception as error:
logging.exception(error)
raise error