[Freeipa-devel] RE-RESEND [PATCH] fix validation return types

Rob Crittenden rcritten at redhat.com
Wed Aug 6 14:44:43 UTC 2008


Stephen Gallagher wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Rob Crittenden wrote:
>> Ok, 3rd time is the charm.
>>
>> The validation routines returned 0/1 instead of True/False which made
>> readability difficult, particularly with the reversed logic.
>>
>> This patch depends on the patch "use same regex for user/group names as
>> shadow-utils".
>>
>> This should address Stephen's concerns.
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Freeipa-devel mailing list
>> Freeipa-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/freeipa-devel
> 
> diff --git a/ipa-python/radius_util.py b/ipa-python/radius_util.py
> index fb3e581..43357b6 100644
> - --- a/ipa-python/radius_util.py
> +++ b/ipa-python/radius_util.py
> @@ -347,7 +347,7 @@ def validate_nastype(nastype, variable_name=None):
>      return True
> 
>  def validate_desc(desc, variable_name=None):
> - -    if ipavalidate.Plain(desc) != 0:
> +    if not ipavalidate.Plain(desc) != 0:
>          print valid_desc_msg
>          return False
>      return True
> 
> 
> 
> "if not ipavalidate.Plain(desc) != 0:" seems wrong to me. Why are you
> still doing the numeric compare?
>

Simply missed one.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20080806/721b4ad4/attachment.bin>


More information about the Freeipa-devel mailing list