Merge "use instance_id as string for plugin sections"
This commit is contained in:
commit
36ed936803
@ -39,7 +39,7 @@ class InitManager(object):
|
||||
if not instance_id:
|
||||
return self._PLUGINS_CONFIG_SECTION
|
||||
else:
|
||||
return instance_id + "/" + self._PLUGINS_CONFIG_SECTION
|
||||
return ("%s/%s" % (instance_id, self._PLUGINS_CONFIG_SECTION))
|
||||
|
||||
def _get_plugin_status(self, osutils, instance_id, plugin_name):
|
||||
return osutils.get_config_value(plugin_name,
|
||||
|
@ -60,14 +60,18 @@ class TestInitManager(unittest.TestCase):
|
||||
if not instance_id:
|
||||
self.assertEqual(self._init._PLUGINS_CONFIG_SECTION, response)
|
||||
else:
|
||||
self.assertEqual(
|
||||
instance_id + "/" + self._init._PLUGINS_CONFIG_SECTION,
|
||||
response)
|
||||
expected_response = (
|
||||
"%s/%s" % (instance_id, self._init._PLUGINS_CONFIG_SECTION))
|
||||
self.assertEqual(expected_response, response)
|
||||
|
||||
def test_get_plugin_section_id(self):
|
||||
fake_id = "100"
|
||||
self._test_get_plugin_section(instance_id=fake_id)
|
||||
|
||||
def test_get_plugin_section_id_int(self):
|
||||
fake_id = 100
|
||||
self._test_get_plugin_section(instance_id=fake_id)
|
||||
|
||||
def test_get_plugin_section_no_id(self):
|
||||
self._test_get_plugin_section(instance_id=None)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user