changed synchronizer_plugins group name to plugins
Change-Id: Ie329d492413f9aef4cb3ecdb5049f12e51e56708
This commit is contained in:
parent
b0f0976d2d
commit
b099e58736
@ -551,7 +551,7 @@
|
||||
#snapshots_interval = 600
|
||||
|
||||
|
||||
[synchronizer_plugins]
|
||||
[plugins]
|
||||
|
||||
#
|
||||
# From vitrage
|
||||
|
@ -154,8 +154,9 @@ class Processor(processor.ProcessorBase):
|
||||
|
||||
def handle_end_message(self, vertex, neighbors):
|
||||
self.initialization_status.end_messages[vertex[VProps.TYPE]] = True
|
||||
|
||||
if len(self.initialization_status.end_messages) == \
|
||||
len(self.conf.synchronizer_plugins.plugin_type):
|
||||
len(self.conf.plugins.plugin_type):
|
||||
self.initialization_status.status = \
|
||||
self.initialization_status.RECEIVED_ALL_END_MESSAGES
|
||||
|
||||
|
@ -208,12 +208,12 @@ class StateManager(object):
|
||||
not attr.startswith("__")]
|
||||
|
||||
def _is_all_plugins_states_exists(self, states_plugins, error_plugins):
|
||||
plugins = self.conf.synchronizer_plugins.plugin_type
|
||||
plugin_types = self.conf.plugins.plugin_type
|
||||
all_state_loaded_plugins = states_plugins + error_plugins
|
||||
|
||||
for plugin in plugins:
|
||||
if plugin not in all_state_loaded_plugins:
|
||||
LOG.error("No state configuration file for: %s", plugin)
|
||||
for plugin_type in plugin_types:
|
||||
if plugin_type not in all_state_loaded_plugins:
|
||||
LOG.error("No state configuration file for: %s", plugin_type)
|
||||
|
||||
@staticmethod
|
||||
def _get_updated_property(new_vertex, graph_vertex, prop):
|
||||
|
@ -36,7 +36,7 @@ class TransformerManager(object):
|
||||
def register_transformer_classes(conf):
|
||||
|
||||
transformers = {}
|
||||
for plugin in conf.synchronizer_plugins.plugin_type:
|
||||
for plugin in conf.plugins.plugin_type:
|
||||
transformers[plugin] = importutils.import_object(
|
||||
conf[plugin].transformer,
|
||||
transformers)
|
||||
|
@ -37,7 +37,7 @@ def list_opts():
|
||||
('api', vitrage.api.OPTS),
|
||||
('synchronizer', vitrage.synchronizer.OPTS),
|
||||
('evaluator', vitrage.evaluator.OPTS),
|
||||
('synchronizer_plugins', vitrage.synchronizer.plugins.OPTS),
|
||||
('plugins', vitrage.synchronizer.plugins.OPTS),
|
||||
('consistency', vitrage.entity_graph.consistency.OPTS),
|
||||
('entity_graph', vitrage.entity_graph.OPTS),
|
||||
('service_credentials', vitrage.keystone_client.OPTS),
|
||||
|
@ -38,8 +38,8 @@ def prepare_service(args=None, conf=None, config_files=None):
|
||||
conf(args, project='vitrage', validate_default_values=True,
|
||||
default_config_files=config_files)
|
||||
|
||||
for plugin_name in conf.synchronizer_plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name, conf.synchronizer_plugins.plugin_path)
|
||||
for plugin_name in conf.plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name, conf.plugins.plugin_path)
|
||||
|
||||
keystone_client.register_keystoneauth_opts(conf)
|
||||
|
||||
|
@ -59,7 +59,7 @@ class Launcher(object):
|
||||
self.conf[plugin].changes_interval,
|
||||
self.callback)
|
||||
|
||||
for plugin in self.conf.synchronizer_plugins.plugin_type
|
||||
for plugin in self.conf.plugins.plugin_type
|
||||
if opt_exists(self.conf[plugin], CHANGES_INTERVAL)),
|
||||
|
||||
(SnapshotsService(self.conf,
|
||||
|
@ -78,8 +78,7 @@ class TestConsistencyFunctional(TestEntityGraphFunctionalBase):
|
||||
self.conf.register_opts(self.PROCESSOR_OPTS, group='entity_graph')
|
||||
self.conf.register_opts(self.EVALUATOR_OPTS, group='evaluator')
|
||||
self.conf.register_opts(self.SYNCHRONIZER_OPTS, group='synchronizer')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self.load_plugins(self.conf)
|
||||
|
||||
self.processor = Processor(self.conf, self.initialization_status)
|
||||
|
@ -33,8 +33,7 @@ class TestProcessorFunctional(TestEntityGraphFunctionalBase):
|
||||
super(TestProcessorFunctional, self).setUp()
|
||||
self.conf = cfg.ConfigOpts()
|
||||
self.conf.register_opts(self.PROCESSOR_OPTS, group='entity_graph')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self.load_plugins(self.conf)
|
||||
|
||||
def test_create_entity_graph(self):
|
||||
|
@ -34,8 +34,7 @@ class TestStateManagerFunctional(TestEntityGraphFunctionalBase):
|
||||
super(TestStateManagerFunctional, self).setUp()
|
||||
self.conf = cfg.ConfigOpts()
|
||||
self.conf.register_opts(self.PROCESSOR_OPTS, group='entity_graph')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self.load_plugins(self.conf)
|
||||
|
||||
def test_state_on_update(self):
|
||||
|
@ -46,11 +46,9 @@ class TestActionExecutor(TestEntityGraphFunctionalBase):
|
||||
def setUpClass(cls):
|
||||
cls.conf = cfg.ConfigOpts()
|
||||
cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph')
|
||||
cls.conf.register_opts(cls.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
for plugin_name in cls.conf.synchronizer_plugins.plugin_type:
|
||||
load_plugin(cls.conf, plugin_name,
|
||||
cls.conf.synchronizer_plugins.plugin_path)
|
||||
cls.conf.register_opts(cls.PLUGINS_OPTS, group='plugins')
|
||||
for plugin_name in cls.conf.plugins.plugin_type:
|
||||
load_plugin(cls.conf, plugin_name, cls.conf.plugins.plugin_path)
|
||||
|
||||
def test_execute_update_vertex(self):
|
||||
|
||||
|
@ -46,8 +46,7 @@ class TestScenarioEvaluator(TestEntityGraphFunctionalBase):
|
||||
cls.conf = cfg.ConfigOpts()
|
||||
cls.conf.register_opts(cls.PROCESSOR_OPTS, group='entity_graph')
|
||||
cls.conf.register_opts(cls.EVALUATOR_OPTS, group='evaluator')
|
||||
cls.conf.register_opts(cls.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
cls.conf.register_opts(cls.PLUGINS_OPTS, group='plugins')
|
||||
TestScenarioEvaluator.load_plugins(cls.conf)
|
||||
cls.scenario_repository = ScenarioRepository(cls.conf)
|
||||
|
||||
|
@ -58,9 +58,8 @@ class TestEntityGraphUnitBase(base.BaseTest):
|
||||
|
||||
@staticmethod
|
||||
def load_plugins(conf):
|
||||
for plugin_name in conf.synchronizer_plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name,
|
||||
conf.synchronizer_plugins.plugin_path)
|
||||
for plugin_name in conf.plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name, conf.plugins.plugin_path)
|
||||
|
||||
def _create_processor_with_graph(self, conf, processor=None):
|
||||
events = self._create_mock_events()
|
||||
|
@ -27,7 +27,7 @@ class TestBaseProcessor(TestEntityGraphUnitBase):
|
||||
super(TestBaseProcessor, self).setUp()
|
||||
self.conf = cfg.ConfigOpts()
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
group='plugins')
|
||||
self.load_plugins(self.conf)
|
||||
self.transform = transformer_manager.TransformerManager(self.conf)
|
||||
|
||||
|
@ -45,8 +45,7 @@ class TestProcessor(TestEntityGraphUnitBase):
|
||||
super(TestProcessor, self).setUp()
|
||||
self.conf = cfg.ConfigOpts()
|
||||
self.conf.register_opts(self.PROCESSOR_OPTS, group='entity_graph')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self.load_plugins(self.conf)
|
||||
|
||||
# TODO(Alexey): un skip this test when instance transformer update is ready
|
||||
|
@ -51,17 +51,15 @@ class TestStateManager(base.BaseTest):
|
||||
|
||||
@staticmethod
|
||||
def _load_plugins(conf):
|
||||
for plugin_name in conf.synchronizer_plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name,
|
||||
conf.synchronizer_plugins.plugin_path)
|
||||
for plugin_name in conf.plugins.plugin_type:
|
||||
load_plugin(conf, plugin_name, conf.plugins.plugin_path)
|
||||
|
||||
# noinspection PyAttributeOutsideInit
|
||||
def setUp(self):
|
||||
super(TestStateManager, self).setUp()
|
||||
self.conf = cfg.ConfigOpts()
|
||||
self.conf.register_opts(self.ENTITY_GRAPH_OPTS, group='entity_graph')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS,
|
||||
group='synchronizer_plugins')
|
||||
self.conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self._load_plugins(self.conf)
|
||||
|
||||
def test_load_state_plugins_without_errors(self):
|
||||
@ -71,7 +69,7 @@ class TestStateManager(base.BaseTest):
|
||||
# test assertions
|
||||
|
||||
# Total plugins plus the evaluator which is not definable
|
||||
total_plugins = len(self.conf.synchronizer_plugins.plugin_type) + 1
|
||||
total_plugins = len(self.conf.plugins.plugin_type) + 1
|
||||
self.assertEqual(total_plugins, len(state_manager.states_plugins))
|
||||
|
||||
def test_load_state_plugins_with_errors(self):
|
||||
@ -83,7 +81,7 @@ class TestStateManager(base.BaseTest):
|
||||
]
|
||||
conf = cfg.ConfigOpts()
|
||||
conf.register_opts(entity_graph_opts, group='entity_graph')
|
||||
conf.register_opts(self.PLUGINS_OPTS, group='synchronizer_plugins')
|
||||
conf.register_opts(self.PLUGINS_OPTS, group='plugins')
|
||||
self._load_plugins(conf)
|
||||
|
||||
# action
|
||||
@ -94,8 +92,7 @@ class TestStateManager(base.BaseTest):
|
||||
erroneous_states_plugins = 2
|
||||
num_valid_plugins = len(state_manager.states_plugins) + \
|
||||
missing_states_plugins + erroneous_states_plugins
|
||||
self.assertEqual(len(conf.synchronizer_plugins.plugin_type),
|
||||
num_valid_plugins)
|
||||
self.assertEqual(len(conf.plugins.plugin_type), num_valid_plugins)
|
||||
|
||||
def test_normalize_state(self):
|
||||
# setup
|
||||
|
@ -53,10 +53,11 @@ class TransformerManagerTest(base.BaseTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.conf = cfg.ConfigOpts()
|
||||
cls.conf.register_opts(cls.OPTS, group='synchronizer_plugins')
|
||||
for plugin_name in cls.conf.synchronizer_plugins.plugin_type:
|
||||
load_plugin(cls.conf, plugin_name,
|
||||
cls.conf.synchronizer_plugins.plugin_path)
|
||||
cls.conf.register_opts(cls.OPTS, group='plugins')
|
||||
|
||||
for plugin_name in cls.conf.plugins.plugin_type:
|
||||
load_plugin(cls.conf, plugin_name, cls.conf.plugins.plugin_path)
|
||||
|
||||
cls.manager = TransformerManager(cls.conf)
|
||||
|
||||
def test_transformer_registration_nagios(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user