summaryrefslogtreecommitdiffstats
path: root/ipalib/parameters.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-12-21 12:14:38 -0500
committerRob Crittenden <rcritten@redhat.com>2010-12-21 12:57:41 -0500
commit1a7f5e0cc4e66db243ce29f09d77479fc981099e (patch)
treecec239493b488b3d11df7ff058151077da0b6f0f /ipalib/parameters.py
parent7bcc533d95f6c8309e789e6a1940f3f65e0a75af (diff)
downloadfreeipa-1a7f5e0cc4e66db243ce29f09d77479fc981099e.tar.gz
freeipa-1a7f5e0cc4e66db243ce29f09d77479fc981099e.tar.xz
freeipa-1a7f5e0cc4e66db243ce29f09d77479fc981099e.zip
Fix reporting of errors when validating parameters.
Print the attribute CLI name instead of its 'real' name. The real name is usually the name of the corresponding LDAP attribute, which is confusing to the user. This way we get: Invalid 'login': blablabla instead of: Invalid 'uid': blablabla Another example: Invalid 'hostname': blablabla instead of: Invalid 'fqdn': blablabla Ticket #435
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r--ipalib/parameters.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 955b9799..feccd7ea 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -748,8 +748,11 @@ class Param(ReadOnly):
for rule in self.all_rules:
error = rule(ugettext, value)
if error is not None:
+ name = self.cli_name
+ if not name:
+ name = self.name
raise ValidationError(
- name=self.name,
+ name=name,
value=value,
index=index,
error=error,