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

Stephen Gallagher sgallagh at redhat.com
Wed Aug 6 14:39:12 UTC 2008


-----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?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkiZt5AACgkQc7MaxVic+2r51gCfYXx8HETIkKlb+2iYKW0hrNxR
rpEAoIZfnggeE6d3vD4C9mad66MULyDr
=Ff0X
-----END PGP SIGNATURE-----




More information about the Freeipa-devel mailing list