Merge "ValueError should use '%' instead of ','"

This commit is contained in:
Jenkins 2014-06-23 05:28:18 +00:00 committed by Gerrit Code Review
commit 1e6f886cf4
2 changed files with 5 additions and 3 deletions

View File

@ -176,7 +176,7 @@ class NeutronManager(object):
# for the same type is a fatal exception
if plugin_inst.get_plugin_type() in self.service_plugins:
raise ValueError(_("Multiple plugins for service "
"%s were configured"),
"%s were configured") %
plugin_inst.get_plugin_type())
self.service_plugins[plugin_inst.get_plugin_type()] = plugin_inst

View File

@ -81,7 +81,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
"neutron.tests.unit.dummy_plugin."
"DummyServicePlugin"])
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):
cfg.CONF.set_override("service_plugins", ["dummy", "dummy"])
@ -102,7 +103,8 @@ class NeutronManagerTestCase(base.BaseTestCase):
cfg.CONF.set_override("core_plugin",
"neutron.tests.unit.test_neutron_manager."
"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):
cfg.CONF.set_override("core_plugin",