From f18cfd7de8e82d465cdd112decd262e6c901b2cb Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 16 Mar 2012 13:30:59 -0400 Subject: 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 --- ipalib/plugins/baseldap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ipalib/plugins/baseldap.py') 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: -- cgit