Fix pylint 2.0 return-related violations

Aiming to support pylint 2.0 some functions and methods must have their
return statements updated in order to fix two new violations:

- `useless-return` (R1711):
  Useless return at end of function or method Emitted when a single
  "return" or "return None" statement is found at the end of function
  or method definition. This statement can safely be removed because
  Python will implicitly return None

- `inconsistent-return-statements` (R1710):
  Either all return statements in a function should return an
  expression, or none of them should. According to PEP8, if any return
  statement returns an expression, any return statements where no value
  is returned should explicitly state this as return None, and an
  explicit return statement should be present at the end of the
  function (if reachable)

Issue: https://pagure.io/freeipa/issue/7614

Signed-off-by: Armando Neto <abiagion@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Armando Neto
2018-07-10 17:14:04 -03:00
committed by Christian Heimes
parent 9222a08c28
commit b4ad0d19a2
29 changed files with 56 additions and 42 deletions

View File

@@ -140,8 +140,6 @@ class PlatformService(object):
with open(paths.SVC_LIST_FILE, 'w') as f:
json.dump(svc_list, f)
return
def stop(self, instance_name="", capture_output=True,
update_service_list=True):
"""
@@ -163,14 +161,12 @@ class PlatformService(object):
with open(paths.SVC_LIST_FILE, 'w') as f:
json.dump(svc_list, f)
return
def reload_or_restart(self, instance_name="", capture_output=True,
wait=True):
return
pass
def restart(self, instance_name="", capture_output=True, wait=True):
return
pass
def is_running(self, instance_name="", wait=True):
return False
@@ -185,22 +181,22 @@ class PlatformService(object):
return False
def enable(self, instance_name=""):
return
pass
def disable(self, instance_name=""):
return
pass
def mask(self, instance_name=""):
return
pass
def unmask(self, instance_name=""):
return
pass
def install(self, instance_name=""):
return
pass
def remove(self, instance_name=""):
return
pass
class SystemdService(PlatformService):

View File

@@ -177,7 +177,7 @@ class BaseTaskNamespace(object):
"""
Migrate pam stack configuration to authselect.
"""
return
pass
def set_selinux_booleans(self, required_settings, backup_func=None):
"""Set the specified SELinux booleans