ValueError should use '%' instead of ','

The method _load_service_plugins() in /neutron/neutron/managers.py
 throw a ValueError using ',' to connect log and variables.
ValueError do not support using ',' to connect log and variables,
we should use '%' instead of ','

Change-Id: Ic9b3756ac2bc36ddc689a66c078e205e0674f513
Closes-Bug:#1264210
This commit is contained in:
Yalei Wang 2014-06-17 10:56:46 +08:00
parent 382795ca1d
commit be9a7f22ee
2 changed files with 5 additions and 3 deletions

View File

@ -175,7 +175,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",