Merge "ValueError should use '%' instead of ','"
This commit is contained in:
commit
1e6f886cf4
@ -176,7 +176,7 @@ class NeutronManager(object):
|
|||||||
# for the same type is a fatal exception
|
# for the same type is a fatal exception
|
||||||
if plugin_inst.get_plugin_type() in self.service_plugins:
|
if plugin_inst.get_plugin_type() in self.service_plugins:
|
||||||
raise ValueError(_("Multiple plugins for service "
|
raise ValueError(_("Multiple plugins for service "
|
||||||
"%s were configured"),
|
"%s were configured") %
|
||||||
plugin_inst.get_plugin_type())
|
plugin_inst.get_plugin_type())
|
||||||
|
|
||||||
self.service_plugins[plugin_inst.get_plugin_type()] = plugin_inst
|
self.service_plugins[plugin_inst.get_plugin_type()] = plugin_inst
|
||||||
|
@ -81,7 +81,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
|
|||||||
"neutron.tests.unit.dummy_plugin."
|
"neutron.tests.unit.dummy_plugin."
|
||||||
"DummyServicePlugin"])
|
"DummyServicePlugin"])
|
||||||
cfg.CONF.set_override("core_plugin", DB_PLUGIN_KLASS)
|
cfg.CONF.set_override("core_plugin", DB_PLUGIN_KLASS)
|
||||||
self.assertRaises(ValueError, manager.NeutronManager.get_instance)
|
e = self.assertRaises(ValueError, manager.NeutronManager.get_instance)
|
||||||
|
self.assertIn(constants.DUMMY, e.message)
|
||||||
|
|
||||||
def test_multiple_plugins_by_name_specified_for_service_type(self):
|
def test_multiple_plugins_by_name_specified_for_service_type(self):
|
||||||
cfg.CONF.set_override("service_plugins", ["dummy", "dummy"])
|
cfg.CONF.set_override("service_plugins", ["dummy", "dummy"])
|
||||||
@ -102,7 +103,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
|
|||||||
cfg.CONF.set_override("core_plugin",
|
cfg.CONF.set_override("core_plugin",
|
||||||
"neutron.tests.unit.test_neutron_manager."
|
"neutron.tests.unit.test_neutron_manager."
|
||||||
"MultiServiceCorePlugin")
|
"MultiServiceCorePlugin")
|
||||||
self.assertRaises(ValueError, manager.NeutronManager.get_instance)
|
e = self.assertRaises(ValueError, manager.NeutronManager.get_instance)
|
||||||
|
self.assertIn(constants.DUMMY, e.message)
|
||||||
|
|
||||||
def test_core_plugin_supports_services(self):
|
def test_core_plugin_supports_services(self):
|
||||||
cfg.CONF.set_override("core_plugin",
|
cfg.CONF.set_override("core_plugin",
|
||||||
|
Loading…
Reference in New Issue
Block a user