[Freeipa-devel] [PATCH] 0006 Raise ACI error when CSR has no subject hostname

Lynn Root lroot at redhat.com
Tue Dec 11 09:22:51 UTC 2012


On 12/11/2012 09:27 AM, Martin Kosek wrote:
> 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 candidate
>>> either for this case.
>>>
>>> IMHO, ValidationError is fine for this situation - but maybe somebody else may
>>> have other opinion...
>>>
>>> Martin
>> 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
> request"))
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "ipalib/errors.py", line 268, in __init__
>      self.msg = self.format % kw
> KeyError: 'name'
>
> Martin
Try #3: added 'name' and 'error' parameters to ValidationError. Thanks 
again, Martin!

-- 
Lynn Root

@roguelynn
Associate Software Engineer
Red Hat, Inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-lroot-0006-03-Raise-ValidationError-when-CSR-does-not-have-a-subje.patch
Type: text/x-patch
Size: 1139 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20121211/1db109c5/attachment.bin>


More information about the Freeipa-devel mailing list