Implemented base + moved plugins & service conf
In this changeset, I implemented the main logic although this is mainly a shameful copy/paste of Nova's blueprint https://blueprints.launchpad.net/nova/+spec/centralize-config-options Partially Implements: blueprint centralise-config-opts Change-Id: Ib645ad5da5c706336bb6ac37e85b027d05665c32
This commit is contained in:
@@ -54,7 +54,7 @@ class TestDBManageRunApp(base.TestCase):
|
||||
dbmanage.main()
|
||||
self.assertEqual(1, m_func.call_count)
|
||||
m_prepare_service.assert_called_once_with(
|
||||
["watcher-db-manage", self.expected])
|
||||
["watcher-db-manage", self.expected], cfg.CONF)
|
||||
|
||||
|
||||
class TestDBManageRunCommand(base.TestCase):
|
||||
|
||||
0
watcher/tests/conf/__init__.py
Normal file
0
watcher/tests/conf/__init__.py
Normal file
@@ -17,7 +17,8 @@
|
||||
import mock
|
||||
from stevedore import extension
|
||||
|
||||
from watcher import opts
|
||||
from watcher.conf import opts
|
||||
from watcher.conf import plugins
|
||||
from watcher.tests import base
|
||||
from watcher.tests.decision_engine import fake_strategies
|
||||
|
||||
@@ -26,10 +27,10 @@ class TestListOpts(base.TestCase):
|
||||
def setUp(self):
|
||||
super(TestListOpts, self).setUp()
|
||||
self.base_sections = [
|
||||
'api', 'watcher_decision_engine', 'watcher_applier',
|
||||
'watcher_planner', 'nova_client', 'glance_client',
|
||||
'cinder_client', 'ceilometer_client', 'neutron_client',
|
||||
'watcher_clients_auth']
|
||||
'DEFAULT', 'api', 'database', 'watcher_decision_engine',
|
||||
'watcher_applier', 'watcher_planner', 'nova_client',
|
||||
'glance_client', 'cinder_client', 'ceilometer_client',
|
||||
'neutron_client', 'watcher_clients_auth']
|
||||
self.opt_sections = list(dict(opts.list_opts()).keys())
|
||||
|
||||
def test_run_list_opts(self):
|
||||
@@ -135,10 +136,10 @@ class TestPlugins(base.TestCase):
|
||||
|
||||
with mock.patch.object(extension, "ExtensionManager") as m_ext_manager:
|
||||
with mock.patch.object(
|
||||
opts, "_show_plugins_ascii_table"
|
||||
plugins, "_show_plugins_ascii_table"
|
||||
) as m_show:
|
||||
m_ext_manager.side_effect = m_list_available
|
||||
opts.show_plugins()
|
||||
plugins.show_plugins()
|
||||
m_show.assert_called_once_with(
|
||||
[('watcher_strategies.strategy_1', 'strategy_1',
|
||||
'watcher.tests.decision_engine.'
|
||||
@@ -20,7 +20,7 @@ from oslo_config import cfg
|
||||
from watcher.common import config
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('host', 'watcher.common.service')
|
||||
CONF.import_opt('host', 'watcher.conf.service')
|
||||
CONF.import_opt('connection', 'oslo_db.options', group='database')
|
||||
CONF.import_opt('sqlite_synchronous', 'oslo_db.options', group='database')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user