summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2012-03-16 13:30:59 -0400
committerMartin Kosek <mkosek@redhat.com>2012-03-20 09:06:52 +0100
commitf18cfd7de8e82d465cdd112decd262e6c901b2cb (patch)
tree8121bcf8053221ae21c1c91e099d6ebf278fe5c3 /ipalib/plugins/baseldap.py
parent2449b4d827f5402369ff9c41e66ea226710e520b (diff)
downloadfreeipa-f18cfd7de8e82d465cdd112decd262e6c901b2cb.tar.gz
freeipa-f18cfd7de8e82d465cdd112decd262e6c901b2cb.tar.xz
freeipa-f18cfd7de8e82d465cdd112decd262e6c901b2cb.zip
Use a consistent parameter name in errors, defaulting to cli_name.
For general command-line errors we want to use the cli_name on output. The exception is when using *attr, we want to return that attribute name in the exception. https://fedorahosted.org/freeipa/ticket/1418
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 92540d8ac..6b629dc24 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -780,8 +780,9 @@ last, after all sets and adds."""),
try:
value = self.params[attr](value)
except errors.ValidationError, err:
- (name, error) = str(err.strerror).split(':')
- raise errors.ValidationError(name=attr, error=error)
+ raise errors.ValidationError(name=attr, error=err.error)
+ except errors.ConversionError, err:
+ raise errors.ValidationError(name=attr, error=err.error)
if self.api.env.in_server:
value = self.params[attr].encode(value)
if append and attr in newdict: