install: fix command line option validation

The code which calls the validators was accidentally removed, re-add it.

https://fedorahosted.org/freeipa/ticket/5386
https://fedorahosted.org/freeipa/ticket/5391
https://fedorahosted.org/freeipa/ticket/5392

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
Jan Cholasta
2015-11-05 10:33:01 +01:00
parent 43654c973c
commit 6a55174bb6
2 changed files with 17 additions and 3 deletions
+5 -2
View File
@@ -282,7 +282,8 @@ class ConfigureTool(admintool.AdminTool):
kwargs = {}
transformed_cls = self._transform(self.configurable_class)
for owner_cls, name in transformed_cls.knobs():
knob_classes = {n: getattr(c, n) for c, n in transformed_cls.knobs()}
for name in knob_classes:
value = getattr(self.options, name, None)
if value is not None:
kwargs[name] = value
@@ -294,8 +295,10 @@ class ConfigureTool(admintool.AdminTool):
try:
cfgr = transformed_cls(**kwargs)
except core.KnobValueError as e:
knob_cls = getattr(transformed_cls, e.name)
knob_cls = knob_classes[e.name]
try:
if self.positional_arguments is None:
raise IndexError
index = self.positional_arguments.index(e.name)
except IndexError:
cli_name = knob_cls.cli_name or e.name.replace('_', '-')