Make test service_plugins override simple

Just make things simple and give a chance to accept that
ordered 'service_plugins' list or tuple for the base test
class NeutronDbPluginV2TestCase.

Change-Id: I7c352ede811703e3a96848378b92cbbf5e109228
Related-Bug: #1809238
This commit is contained in:
LIU Yulong 2018-12-17 10:35:33 +08:00
parent eeb06ce54d
commit 76c2881201

View File

@ -131,6 +131,10 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase):
'DhcpAgentNotifyAPI').start()
# Update the plugin
self.setup_coreplugin(plugin, load_plugins=False)
if isinstance(service_plugins, (list, tuple)):
# Sometimes we needs these test service_plugins to be ordered.
cfg.CONF.set_override('service_plugins', service_plugins)
else:
cfg.CONF.set_override(
'service_plugins',
[test_lib.test_config.get(key, default)