@@ -312,7 +312,7 @@ the information provided by the module"""
# Ignore if a section is not found
cfg = None
- grparser = parser.add_argument_group("Options for the %s module" % shortmod)
+ modgrparser = parser.add_argument_group("Options for the %s module" % shortmod)
for (o, s) in list(opts.items()):
descr = 'descr' in s and s['descr'] or ""
metavar = 'metavar' in s and s['metavar'] or None
@@ -327,13 +327,15 @@ the information provided by the module"""
default = 'default' in s and s['default'] or None
- grparser.add_argument('--%s-%s' % (shortmod, o),
- dest="%s___%s" % (shortmod, o),
- action='store',
- help='%s%s' % (descr,
- default and ' (default: %s)' % default or ''),
- default=default,
- metavar=metavar)
+ modgrparser.add_argument('--%s-%s' % (shortmod, o),
+ dest="%s___%s" % (shortmod, o),
+ action='store',
+ help='%s%s' % (descr,
+ default and ' (default: %s)' % default or ''),
+ default=default,
+ metavar=metavar)
+
+ return grparser
def InstantiateModule(self, modname, modcfg, modroot=None):
Return grparser from ModuleContainer.SetupModuleOptions, which allows it to be used to setup additional options in *Modules class. Signed-off-by: Tomas Glozar <tglozar@redhat.com> --- rteval/modules/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)