Fix pylint warnings inconsistent-return-statements

Add consistent return to all functions and methods that are covered by
tox -e pylint[23]. I haven't checked if return None is always a good
idea or if we should rather raise an error.

See: https://pagure.io/freeipa/issue/7326
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Christian Heimes
2017-12-18 11:51:14 +01:00
parent a7ae2dbc5f
commit 8cb756a229
14 changed files with 85 additions and 26 deletions
+4 -1
View File
@@ -232,6 +232,7 @@ class CheckedIPAddress(UnsafeIPAddress):
if ifnet.ip == self:
return InterfaceDetails(interface, ifnet)
return None
def set_ip_net(self, ifnet):
"""Set IP Network details for this address. IPNetwork is valid only
@@ -928,7 +929,7 @@ def ipa_generate_password(entropy_bits=256, uppercase=1, lowercase=1, digits=1,
def user_input(prompt, default = None, allow_empty = True):
if default == None:
if default is None:
while True:
try:
ret = input("%s: " % prompt)
@@ -980,6 +981,8 @@ def user_input(prompt, default = None, allow_empty = True):
else:
return ret
return None
def host_port_open(host, port, socket_type=socket.SOCK_STREAM,
socket_timeout=None, log_errors=False,