[Freeipa-devel] [PATCH] 212 Fix integer validation when boundary value is empty string

Endi Sukma Dewata edewata at redhat.com
Tue Sep 18 02:45:26 UTC 2012


On 9/11/2012 10:09 AM, Petr Vobornik wrote:
> There was an error in number validation check. If boundary value was an
> empty string, validation of a number always failed. This patch fixes the
> problem by not performing the check in these cases.
>
> Basic unit tests for IPA.metadata_validator created.

ACK. Some comments:

1. Instead of IPA.not_defined() it might be better to call it 
IPA.defined() to avoid double negations like this:

   if (!IPA.not_defined(metadata.minvalue, true) ...

2. The check_empty_str probably could made optional and the value would 
be true by default. It will make the code cleaner.

-- 
Endi S. Dewata




More information about the Freeipa-devel mailing list