Add plugin interface for extending sample config generation
This commit adds a method to the external plugin interface to extend
the list of config options that gets passed to the sample config
generator.
Partially implements bp external-plugin-interface
Change-Id: I3d28b93aa0cbd05cff3322ff60afadd18baf354a
diff --git a/tempest/test_discover/plugins.py b/tempest/test_discover/plugins.py
index 45cd609..640b004 100644
--- a/tempest/test_discover/plugins.py
+++ b/tempest/test_discover/plugins.py
@@ -51,6 +51,16 @@
"""
return
+ @abc.abstractmethod
+ def get_opt_lists(self):
+ """Method to get a list of options for sample config generation
+
+ :return option_list: A list of tuples with the group name and options
+ in that group.
+ :rtype: list
+ """
+ return []
+
@misc.singleton
class TempestTestPluginManager(object):
@@ -79,3 +89,11 @@
def register_plugin_opts(self, conf):
for plug in self.ext_plugins:
plug.obj.register_opts(conf)
+
+ def get_plugin_options_list(self):
+ plugin_options = []
+ for plug in self.ext_plugins:
+ opt_list = plug.obj.get_opt_lists()
+ if opt_list:
+ plugin_options.extend(opt_list)
+ return plugin_options