def _start(): MODULES.register(MjCastServerModule())
def _start(): MODULES.register(JobModule())
def _start(): MODULES.register(MetricsModule())
def _start(): MODULES.register(ProbesModule())
def _start(): MODULES.register(ReplayModule())
def load_conf(xfile, options=None): signal.signal(signal.SIGTERM, stop) signal.signal(signal.SIGINT, stop) config_dir = os.path.dirname(os.path.abspath(xfile)) with open(xfile, 'r') as f: conf = parse_conf(load_yaml(f)) for name, module in MODULES.iteritems(): LOG.info("module init: %r", name) module.init(conf) for x in ('module', 'plugin'): path = conf['general'].get('%ss_path' % x) if path and os.path.isdir(path): DwhoLibLoader.load_dir(x, path) if not conf.get('endpoints'): raise FdReplayConfigurationError( "Missing 'endpoints' section in configuration") for name, ept_cfg in conf['endpoints'].iteritems(): cfg = { 'general': dict(conf['general']), 'fd-replay': { 'endpoint_name': name, 'config_dir': config_dir }, 'vars': {}, 'config': {} } if 'plugin' not in ept_cfg: raise FdReplayConfigurationError( "Missing 'plugin' option in endpoint: %r" % name) if ept_cfg['plugin'] not in PLUGINS: raise FdReplayConfigurationError( "Invalid plugin %r in endpoint: %r" % (ept_cfg['plugin'], name)) cfg['fd-replay']['plugin_name'] = ept_cfg['plugin'] for x in ('config', 'vars'): if ept_cfg.get("import_%s" % x): cfg[x].update( import_file(ept_cfg["import_%s" % x], config_dir, cfg)) if x in ept_cfg: cfg[x].update(dict(ept_cfg[x])) cfg['credentials'] = None if ept_cfg.get('credentials'): cfg['credentials'] = ept_cfg['credentials'] endpoint = PLUGINS[ept_cfg['plugin']](name) ENDPOINTS.register(endpoint) LOG.info("endpoint init: %r", name) endpoint.init(cfg) LOG.info("endpoint safe_init: %r", name) endpoint.safe_init() DWHO_THREADS.append(endpoint.at_stop) if not options or not isinstance(options, object): return conf for def_option in get_default_options().iterkeys(): if getattr(options, def_option, None) is None \ and def_option in conf['general']: setattr(options, def_option, conf['general'][def_option]) setattr(options, 'configuration', conf) return options
def _start(): MODULES.register(PDNSModule())
def _start(): MODULES.register(DWhoModuleWeb())
def _start(): MODULES.register(BotbondServerModule())