Module: check_mk
Branch: master
Commit: 89cd158aae399a3bd4e68238ad962dc9867575cc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89cd158aae399a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Jul 6 11:33:02 2018 +0200
Fixed and enabled useless-else-on-loop warnings.
Change-Id: Id0e2224a12fa8ab9ab668259d1a45b58cd6b6ddf
---
checks/casa_fan | 3 +--
cmk_base/checking.py | 3 +--
tests/pylint/pylintrc | 1 -
web/plugins/wato/check_parameters.py | 3 +--
4 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/checks/casa_fan b/checks/casa_fan
index 9cff0a9..0f6b91f 100644
--- a/checks/casa_fan
+++ b/checks/casa_fan
@@ -45,8 +45,7 @@ def check_casa_fan(item, no_params, info):
return (3, "%s RPM, unknown fan status (!)" % speed)
elif fan_status == "4":
return (2, "FAN Failure (!!)")
- else:
- return (3, "Fan %s not found in snmp output" % item)
+ return (3, "Fan %s not found in snmp output" % item)
check_info["casa_fan"] = {
diff --git a/cmk_base/checking.py b/cmk_base/checking.py
index ba40093..9794706 100644
--- a/cmk_base/checking.py
+++ b/cmk_base/checking.py
@@ -330,8 +330,7 @@ def _determine_check_params(params):
elif tp_result == None:
# Connection error
return params["tp_default_value"]
- else:
- return params["tp_default_value"]
+ return params["tp_default_value"]
else:
return params
diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc
index a19eb63..b0bd527 100644
--- a/tests/pylint/pylintrc
+++ b/tests/pylint/pylintrc
@@ -81,7 +81,6 @@ disable=
unused-import,
unused-variable,
unused-wildcard-import,
- useless-else-on-loop,
useless-super-delegation,
wildcard-import,
wrong-import-order,
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 6e7139f..68c7117 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -7727,8 +7727,7 @@ def match_dual_level_type(value):
for entry in value:
if entry[1][0] < 0 or entry[1][1] < 0:
return 1
- else:
- return 0
+ return 0
else:
if value[0] < 0 or value[1] < 0:
return 1