def setUpClass(cls): cls.conf = cfg.ConfigOpts() cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph') cls.conf.register_opts(cls.DATASOURCES_OPTS, group='datasources') for datasource_name in cls.conf.datasources.types: register_opts(cls.conf, datasource_name, cls.conf.datasources.path)
def prepare_service(args=None, conf=None, config_files=None): if conf is None: conf = cfg.ConfigOpts() log.register_options(conf) policy_opts.set_defaults(conf) for group, options in opts.list_opts(): conf.register_opts(list(options), group=None if group == 'DEFAULT' else group) conf(args, project='vitrage', validate_default_values=True, default_config_files=config_files) for datasource in conf.datasources.types: register_opts(conf, datasource, conf.datasources.path) keystone_client.register_keystoneauth_opts(conf) keystone_client.setup_keystoneauth(conf) log.setup(conf, 'vitrage') conf.log_opt_values(LOG, logging.DEBUG) messaging.setup() return conf
def parse_config(args, default_config_files=None): set_defaults() log.register_options(CONF) policy_opts.set_defaults(CONF) osprofiler_opts.set_defaults(CONF) db_options.set_defaults(CONF) for group, options in opts.list_opts(): CONF.register_opts(list(options), group=None if group == 'DEFAULT' else group) CONF(args[1:], project='vitrage', validate_default_values=True, default_config_files=default_config_files) if CONF.profiler.enabled: osprofiler_initializer.init_from_conf(conf=CONF, context=None, project='vitrage', service='api', host=CONF.api.host) for datasource in CONF.datasources.types: opts.register_opts(datasource, CONF.datasources.path) keystone_client.register_keystoneauth_opts() log.setup(CONF, 'vitrage') CONF.log_opt_values(LOG, log.DEBUG) messaging.setup()
def prepare_service(args=None, conf=None, config_files=None): set_defaults() if conf is None: conf = cfg.ConfigOpts() log.register_options(conf) policy_opts.set_defaults(conf) osprofiler_opts.set_defaults(conf) db_options.set_defaults(conf) for group, options in opts.list_opts(): conf.register_opts(list(options), group=None if group == 'DEFAULT' else group) conf(args, project='vitrage', validate_default_values=True, default_config_files=config_files) if conf.profiler.enabled: osprofiler_initializer.init_from_conf(conf=conf, context=None, project="vitrage", service="api", host=conf.api.host) for datasource in conf.datasources.types: register_opts(conf, datasource, conf.datasources.path) keystone_client.register_keystoneauth_opts(conf) log.setup(conf, 'vitrage') conf.log_opt_values(LOG, log.DEBUG) messaging.setup() return conf
def setUpClass(cls): cls.conf = cfg.ConfigOpts() cls.conf.register_opts(cls.OPTS, group='datasources') for datasource in cls.conf.datasources.types: register_opts(cls.conf, datasource, cls.conf.datasources.path) cls.manager = TransformerManager(cls.conf)
def setUpClass(cls): super(TestActionExecutor, cls).setUpClass() cls.conf = cfg.ConfigOpts() cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph') cls.conf.register_opts(cls.DATASOURCES_OPTS, group='datasources') cls.add_db(cls.conf) for vitrage_type in cls.conf.datasources.types: register_opts(cls.conf, vitrage_type, cls.conf.datasources.path)
def get_notifier_plugins(): notifiers = [] conf_notifier_names = CONF.notifiers if not conf_notifier_names: LOG.info('There are no notifier plugins in configuration') return [] for notifier_name in conf_notifier_names: register_opts(notifier_name, CONF.notifiers_path) LOG.info('Notifier plugin %s started', notifier_name) notifiers.append( importutils.import_object(CONF[notifier_name].notifier)) return notifiers
def get_notifier_plugins(conf): notifiers = [] conf_notifier_names = conf.notifiers if not conf_notifier_names: LOG.info('There are no notifier plugins in configuration') return [] for notifier_name in conf_notifier_names: register_opts(conf, notifier_name, conf.notifiers_path) LOG.info('Notifier plugin %s started', notifier_name) notifiers.append(importutils.import_object( conf[notifier_name].notifier, conf)) return notifiers
def setUp(self): super(TransformerManagerTest, self).setUp() self.cfg_fixture.config(group='datasources', types=[ NAGIOS_DATASOURCE, NOVA_HOST_DATASOURCE, NOVA_INSTANCE_DATASOURCE, NOVA_ZONE_DATASOURCE ]) for datasource in self.conf.datasources.types: register_opts(datasource, self.conf.datasources.path) self.manager = TransformerManager()
def setUpClass(cls): super(TestActionExecutor, cls).setUpClass() cls.conf = cfg.ConfigOpts() cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph') cls.conf.register_opts(cls.DATASOURCES_OPTS, group='datasources') cls.conf.register_opts(database_opts, group='database') cls.conf.set_override('connection', 'sqlite:///:memory:', group='database') cls._db = storage.get_connection_from_config(cls.conf) engine = cls._db._engine_facade.get_engine() models.Base.metadata.create_all(engine) for datasource_name in cls.conf.datasources.types: register_opts(cls.conf, datasource_name, cls.conf.datasources.path)
def get_machine_learning_plugins(conf): machine_learning_plugins = [] machine_learning_plugins_names = \ conf.machine_learning.plugins if not machine_learning_plugins_names: LOG.info('There are no Machine Learning plugins in configuration') return [] for machine_learning_plugin_name in machine_learning_plugins_names: register_opts(conf, machine_learning_plugin_name, conf.machine_learning.plugins_path) LOG.info('Machine Learning plugin %s started', machine_learning_plugin_name) machine_learning_plugins.append( importutils.import_object( conf[machine_learning_plugin_name].plugin_path, conf)) return machine_learning_plugins
def _load_datasources(conf): for datasource_name in conf.datasources.types: register_opts(conf, datasource_name, conf.datasources.path)
def load_datasources(conf): for datasource in conf.datasources.types: register_opts(conf, datasource, conf.datasources.path)
def setUp(self): super(TestActionExecutor, self).setUp() self.add_db() for datasource_name in self.conf.datasources.types: register_opts(datasource_name, self.conf.datasources.path)
def _load_datasources(conf): for vitrage_type in conf.datasources.types: register_opts(conf, vitrage_type, conf.datasources.path)
def _load_datasources(self): for datasource_name in self.conf.datasources.types: register_opts(datasource_name, self.conf.datasources.path)
def load_datasources(self): for datasource in CONF.datasources.types: register_opts(datasource, CONF.datasources.path)