[Freeipa-devel] [PATCH] 251 additional pylint fixes

Rob Crittenden rcritten at redhat.com
Thu Aug 13 13:27:01 UTC 2009


Martin Nagy wrote:
> On Wed, 2009-08-12 at 13:16 -0400, Rob Crittenden wrote:
>> I fixed a few more issues discovered by pylint.
>>
>> rob
> 
> [snip]
> --- a/ipapython/ipautil.py
> +++ b/ipapython/ipautil.py
> @@ -605,10 +605,11 @@ def user_input_path(prompt, default = None,
> allow_empty = True):
>          prompt += " (enter \"none\" for empty)"
>      while True:
>          ret = user_input(prompt, default, allow_empty)
> -        if allow_empty and ret.lower() == "none":
> -            return ""
> -        if ipavalidate.Path(ret, not allow_empty):
> -            return ret
> +        if isinstance(ret, basestring):
> +            if allow_empty and ret.lower() == "none":
> +                return ""
> +            if ipavalidate.Path(ret, not allow_empty):
> +                return ret
> 
> I don't like this piece. The return of user_input() should always be a
> string unless the default parameter of user_input_path() is a bool or
> int. Assert at the beginning of user_input_path() would be better.
> 
> But anyway, it seems we don't use this function anyway (probably after
> we changed to the plug-in framework), so I'd vote to completely remove
> it instead.
> 
> Martin
> 

Yup, good call. Revised patch attached.

rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-251-2-lint.patch
Type: application/mbox
Size: 7058 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20090813/b7618b85/attachment.mbox>
-------------- 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/20090813/b7618b85/attachment.bin>


More information about the Freeipa-devel mailing list