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

Martin Kosek mkosek at redhat.com
Tue Dec 11 11:30:49 UTC 2012


On 12/11/2012 10:22 AM, Lynn Root wrote:
> 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!
> 

ACK. Pushed to master, ipa-3-1.

Martin




More information about the Freeipa-devel mailing list