diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2015-11-02 15:32:35 +0100 |
|---|---|---|
| committer | Jan Cholasta <jcholast@redhat.com> | 2015-11-05 10:33:01 +0100 |
| commit | 6a55174bb6c24632bbd46c8421399343e1282ce0 (patch) | |
| tree | 9c59548241cd8d1dd0079c37e547a5c22d0b55e7 /ipapython/install/core.py | |
| parent | 43654c973c5977ae55250a30b5652f160b11d590 (diff) | |
| download | freeipa-6a55174bb6c24632bbd46c8421399343e1282ce0.tar.gz freeipa-6a55174bb6c24632bbd46c8421399343e1282ce0.tar.xz freeipa-6a55174bb6c24632bbd46c8421399343e1282ce0.zip | |
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>
Diffstat (limited to 'ipapython/install/core.py')
| -rw-r--r-- | ipapython/install/core.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ipapython/install/core.py b/ipapython/install/core.py index 479149be6..8e3ba5802 100644 --- a/ipapython/install/core.py +++ b/ipapython/install/core.py @@ -118,6 +118,16 @@ class KnobBase(PropertyBase): def __init__(self, outer): self.outer = outer + def __set__(self, obj, value): + try: + self.validate(value) + except KnobValueError: + raise + except ValueError as e: + raise KnobValueError(self.__outer_name__, str(e)) + + super(KnobBase, self).__set__(obj, value) + def validate(self, value): pass @@ -243,7 +253,8 @@ class Configurable(six.with_metaclass(abc.ABCMeta, object)): except KeyError: pass else: - setattr(self, name, value) + prop = prop_cls(self) + prop.__set__(self, value) if kwargs: extra = sorted(kwargs) |
