On 12/11/2012 09:24 AM, Lynn Root wrote:
>> The following raises ACIError because of failed authorization check, I think
>> its ok.
>> RequirementError is only thrown when a command option that is required is not
>> passed by the user. I am not fond of expanding its use to the validation of
>> user content, like CSR file.
>> NotFound error is used when an _entry_ is not found - so not an ideal
>> either for this case.
>> IMHO, ValidationError is fine for this situation - but maybe somebody else
>> have other opinion...
> I assume no one is up in arms about electing to go for ValidationError :)
> New patch attached. Thanks for your help, Martin!
This is better. Though this raise statement would raise a different exception
that one would expect...
>>> from ipalib import errors, _
>>> raise errors.ValidationError(info=_("No hostname was found in subject of
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ipalib/errors.py", line 268, in __init__
self.msg = self.format % kw
Freeipa-devel mailing list