# IRMA specific debug messages are enables through # config file Section: log / Key: debug if config.debug_enabled(): def after_setup_logger_handler(sender=None, logger=None, loglevel=None, logfile=None, format=None, colorize=None, **kwds): config.setup_debug_logger(logging.getLogger(__name__)) log.debug("debug is enabled") celery.signals.after_setup_logger.connect(after_setup_logger_handler) celery.signals.after_setup_task_logger.connect(after_setup_logger_handler) # disable insecure serializer (disabled by default from 3.x.x) if (kombu.VERSION.major) < 3: kombu.disable_insecure_serializers() # declare a new Local Probe application probe_app = Celery("probe.tasks") config.conf_probe_celery(probe_app) config.configure_syslog(probe_app) # discover plugins located at specified path plugin_path = os.path.abspath("modules") if not os.path.exists(plugin_path): log.error("path {0} is invalid, cannot load probes".format(plugin_path)) sys.exit(1) manager = PluginManager() manager.discover(plugin_path) # determine dynamically queues to connect to using plugin names
from celery import Celery, current_task from celery.utils.log import get_task_logger from lib.irma.ftp.handler import FtpTls from lib.plugins import PluginManager from lib.common.utils import to_unicode ############################################################################## # celery application configuration ############################################################################## log = get_task_logger(__name__) # disable insecure serializer (disabled by default from 3.x.x) if (kombu.VERSION.major) < 3: kombu.disable_insecure_serializers() # declare a new application app = Celery("probe.tasks") config.conf_probe_celery(app) config.configure_syslog(app) # discover plugins located at specified path plugin_path = os.path.abspath("modules") if not os.path.exists(plugin_path): log.error("path {0} is invalid, cannot load probes".format(plugin_path)) sys.exit(1) manager = PluginManager() manager.discover(plugin_path) # determine dynamically queues to connect to using plugin names