Module: check_mk
Branch: master
Commit: 82dc30b4c9df9d61c3c06feba4d7489c78497651
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=82dc30b4c9df9d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 22 16:56:40 2016 +0200
Fixed some pylint validation errors
---
modules/automation.py | 6 ++++++
modules/check_mk.py | 4 ++--
pylint/pylintrc.checks | 13 +++++++++----
pylint/pylintrc.modules | 13 +++++++++----
4 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/modules/automation.py b/modules/automation.py
index 13deccd..8be74cd 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -237,6 +237,7 @@ def automation_set_autochecks(args):
new_items = eval(sys.stdin.read())
set_autochecks_of(hostname, new_items)
trigger_discovery_check(hostname)
+ return None
# if required, schedule an inventory check
@@ -417,6 +418,8 @@ def automation_delete_host(args):
import shutil
shutil.rmtree("%s/%s" % (logwatch_dir, hostname))
+ return None
+
def automation_restart(job = "restart"):
if check_plugins_have_changed():
@@ -1381,6 +1384,7 @@ def automation_create_or_edit_package(args, mode):
create_package(new_package_info)
else:
edit_package(package_name, new_package_info)
+ return None
def automation_install_package(args):
@@ -1405,6 +1409,7 @@ def automation_remove_or_release_package(args, mode):
remove_package(package)
else:
remove_package_info(package_name)
+ return None
def automation_remove_unpackaged_file(args):
@@ -1423,3 +1428,4 @@ def automation_remove_unpackaged_file(args):
if not os.path.isfile(abspath):
raise MKAutomationError("No such file")
os.remove(abspath)
+ return None
diff --git a/modules/check_mk.py b/modules/check_mk.py
index c82e356..11d51be 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3276,11 +3276,11 @@ def create_core_config():
verify_non_deprecated_checkgroups()
if monitoring_core == "cmc":
- warnings = do_create_cmc_config(opt_cmc_relfilename)
+ do_create_cmc_config(opt_cmc_relfilename)
else:
load_module("nagios")
out = file(nagios_objects_file, "w")
- warnings = create_nagios_config(out)
+ create_nagios_config(out)
num_warnings = len(g_configuration_warnings)
if num_warnings > 10:
diff --git a/pylint/pylintrc.checks b/pylint/pylintrc.checks
index 1ce71b5..a4468df 100644
--- a/pylint/pylintrc.checks
+++ b/pylint/pylintrc.checks
@@ -9,10 +9,15 @@ errors-only=yes
# C0111 missing module docstring
# C0326 bad-whitespace
disable=C0111,C0326
-# Disable this because we often use multiple types for a single variable. Maybe we
-# can change this in future to make such linter checks work, but for the moment these
-# checks are useless with Check_MK.
-disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence
+# unsubscriptable-object
+# unsupported-membership-test
+# unpacking-non-sequence
+# Disable this because we often use multiple types for a single variable. Maybe we
+# can change this in future to make such linter checks work, but for the moment these
+# checks are useless with Check_MK.
+# unpacking-non-sequence
+# Not a problem for us
+disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
[TYPECHECK]
# Can not check methods / attributes of the rrdtool C module. Skipping related errors
diff --git a/pylint/pylintrc.modules b/pylint/pylintrc.modules
index 089938b..40a030b 100644
--- a/pylint/pylintrc.modules
+++ b/pylint/pylintrc.modules
@@ -9,10 +9,15 @@ errors-only=yes
# C0111 missing module docstring
# C0326 bad-whitespace
disable=C0111,C0326
-# Disable this because we often use multiple types for a single variable. Maybe we
-# can change this in future to make such linter checks work, but for the moment these
-# checks are useless with Check_MK.
-disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence
+# unsubscriptable-object
+# unsupported-membership-test
+# unpacking-non-sequence
+# Disable this because we often use multiple types for a single variable. Maybe we
+# can change this in future to make such linter checks work, but for the moment these
+# checks are useless with Check_MK.
+# unpacking-non-sequence
+# Not a problem for us
+disable=unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none
[TYPECHECK]
# Can not check methods / attributes of the rrdtool C module. Skipping related errors