diff options
author | Rob Crittenden <rcritten@redhat.com> | 2012-03-16 13:30:59 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-03-20 09:06:52 +0100 |
commit | f18cfd7de8e82d465cdd112decd262e6c901b2cb (patch) | |
tree | 8121bcf8053221ae21c1c91e099d6ebf278fe5c3 /ipalib/plugins | |
parent | 2449b4d827f5402369ff9c41e66ea226710e520b (diff) | |
download | freeipa-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')
-rw-r--r-- | ipalib/plugins/baseldap.py | 5 |
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: |