Module: check_mk
Branch: master
Commit: 3648f3555594e4802643aa14120dfe183d8d28ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3648f3555594e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 27 13:38:07 2016 +0200
Fixed different issues in active checks found by pylint
---
doc/treasures/active_checks/check_cpu_peaks | 4 ++++
doc/treasures/active_checks/check_form_submit | 4 ++--
doc/treasures/active_checks/check_mail | 4 ++--
pylintrc | 1 +
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/doc/treasures/active_checks/check_cpu_peaks
b/doc/treasures/active_checks/check_cpu_peaks
index ea0ae38..408bf24 100755
--- a/doc/treasures/active_checks/check_cpu_peaks
+++ b/doc/treasures/active_checks/check_cpu_peaks
@@ -107,6 +107,8 @@ try:
util_total = []
is_windows = True
try:
+ # can not check for get_rrd_data because it's hacky included with execfile
+ # pylint: disable=undefined-variable
data = get_rrd_data(host, "CPU utilization", "util",
"MAX", fromtime, untiltime)
datasets.append(data[1])
step_secs = data[0]
@@ -118,6 +120,8 @@ try:
# looks like this is not a windows rrd...
is_windows = False
for key in ["system", "user", "wait"]:
+ # can not check for get_rrd_data because it's hacky included with
execfile
+ # pylint: disable=undefined-variable
data = get_rrd_data(host, "CPU utilization", key, "MAX",
fromtime, untiltime)
datasets.append(data[1])
step_secs = data[0]
diff --git a/doc/treasures/active_checks/check_form_submit
b/doc/treasures/active_checks/check_form_submit
index 5f1edca..65b3d4f 100755
--- a/doc/treasures/active_checks/check_form_submit
+++ b/doc/treasures/active_checks/check_form_submit
@@ -144,7 +144,7 @@ def debug(s):
if opt_debug:
sys.stderr.write('%s\n' % s)
-class HostResult():
+class HostResult(Exception):
def __init__(self, result):
self.result = result
@@ -184,7 +184,7 @@ def open_url(url, method = 'GET', data = None):
if method == 'GET' and data is not None:
# Add the query string to the url in this case
start = '?' in url and '&' or '?'
- url += start + '&'.join([ '='.join(item) in data.items() ])
+ url += start + '&'.join([ '='.join(item) for item in
data.items() ])
data = None
try:
diff --git a/doc/treasures/active_checks/check_mail
b/doc/treasures/active_checks/check_mail
index 306a07e..85b9dad 100755
--- a/doc/treasures/active_checks/check_mail
+++ b/doc/treasures/active_checks/check_mail
@@ -115,7 +115,7 @@ fetch_user = None
fetch_pass = None
fetch_ssl = False
conn_timeout = 10
-cleanup_messages = False
+cleanup_messages = ""
forward_ec = False
forward_facility = 16 # default to "mail" (2 << 3)
forward_app = None
@@ -346,7 +346,7 @@ def forward_to_ec(mails):
sock.send(message + "\n")
sock.close()
- elif not forward_method.startswith('spool:'):
+ elif not forward_method.startswith('spool:'): # pylint:
disable=no-member
# write into local event pipe
# Important: When the event daemon is stopped, then the pipe
# is *not* existing! This prevents us from hanging in such
diff --git a/pylintrc b/pylintrc
new file mode 120000
index 0000000..0dba11a
--- /dev/null
+++ b/pylintrc
@@ -0,0 +1 @@
+pylint/pylintrc
\ No newline at end of file