diff options
author | Pavel Zuna <pzuna@redhat.com> | 2009-08-25 14:37:41 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-09-10 10:01:05 -0400 |
commit | fa140e7f2a03023b83ef37f155a3fbefb1bda8c5 (patch) | |
tree | e1ee6bd6189317bcc493e51c52b25ade119a7f23 /ipalib/parameters.py | |
parent | 9fcd431477737122628ded5c1f14bba2daf6effb (diff) | |
download | freeipa.git-fa140e7f2a03023b83ef37f155a3fbefb1bda8c5.tar.gz freeipa.git-fa140e7f2a03023b83ef37f155a3fbefb1bda8c5.tar.xz freeipa.git-fa140e7f2a03023b83ef37f155a3fbefb1bda8c5.zip |
Remove parent_key parameter kwarg.
Also replace a TYPE_ERROR with ValidationError.
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 1b3b2b71..f05c1ed4 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -227,7 +227,6 @@ class Param(ReadOnly): ('required', bool, True), ('multivalue', bool, False), ('primary_key', bool, False), - ('parent_key', bool, False), ('normalizer', callable, None), ('default_from', DefaultFrom, None), ('create_default', callable, None), @@ -631,12 +630,10 @@ class Param(ReadOnly): def _validate_scalar(self, value, index=None): if type(value) is not self.type: - if index is None: - name = 'value' - else: - name = 'value[%d]' % index - raise TypeError( - TYPE_ERROR % (name, self.type, value, type(value)) + raise ValidationError(name=self.name, + error='need a %r; got %r (a %r)' % ( + self.type, value, type(value) + ) ) if index is not None and type(index) is not int: raise TypeError( |