[Freeipa-devel] [PATCH] 251 additional pylint fixes
Rob Crittenden
rcritten at redhat.com
Thu Aug 20 13:20:06 UTC 2009
Martin Nagy wrote:
> On Thu, 2009-08-13 at 09:27 -0400, Rob Crittenden wrote:
>> 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
>
> Ack.
> Martin
>
pushed to master
-------------- 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/20090820/c7ce05b3/attachment.bin>
More information about the Freeipa-devel
mailing list