Add docstring example for get_opt_lists

Add an example (typical) implementation of get_opt_lists.

Change-Id: If597838f828f81c0919c11a8436b1a0d322758a4
Andrea Frittoli 2017-04-24 11:02:39 +01:00
parent be0ba59743
commit f1c6825210
1 changed files with 25 additions and 0 deletions

View File

@ -92,6 +92,31 @@ class TempestPlugin(object):
:return option_list: A list of tuples with the group name and options
in that group.
:rtype: list
# Config options are defined in a module
service_option = cfg.BoolOpt(
"my_service", default=True,
help="Whether or not my service is available")
my_service_group = cfg.OptGroup(name="my-service",
title="My service options")
my_service_features_group = cfg.OptGroup(
title="My service available features")
MyServiceGroup = [<list of options>]
MyServiceFeaturesGroup = [<list of options>]
# Plugin is implemented in a module
from my_plugin import config as my_config
def get_opt_lists(self, conf):
return [
(, MyServiceGroup),
(, MyServiceFeaturesGroup)
return []