Module: check_mk
Branch: master
Commit: 3648f7716976fbcfb9a3fbf26334c6a48dc1a770
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3648f7716976fb…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Apr 12 11:11:09 2019 +0200
Removed global pylint pragmas from a few files.
These files glued together before checking, so global pragmas have
unpredictable and unintentional side effects. The pragmas are now more
local. TODO: Check if we can remove them by doing things differently.
Change-Id: I62d2b824672739a1aeedbdfa76781b05dcb92485
---
checks/aws_s3 | 2 +-
checks/aws_s3_limits | 2 +-
checks/aws_s3_requests | 2 +-
checks/bdtms_tape_info | 4 ++--
checks/bdtms_tape_status | 4 ++--
checks/df.include | 2 +-
checks/docker_container_status | 2 +-
checks/docker_node_disk_usage | 2 +-
checks/docker_node_info | 2 +-
checks/filestats | 1 -
checks/legacy_docker.include | 2 +-
checks/size_trend.include | 3 +--
cmk_base/check_api.py | 19 +++++++++----------
inventory/docker_container_labels | 2 --
14 files changed, 22 insertions(+), 27 deletions(-)
diff --git a/checks/aws_s3 b/checks/aws_s3
index 76295b7..c81704b 100644
--- a/checks/aws_s3
+++ b/checks/aws_s3
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
-def parse_aws_s3(info):
+def parse_aws_s3(info): # pylint: disable=function-redefined
parsed = {}
for row in parse_aws(info):
bucket = parsed.setdefault(row['Label'], {})
diff --git a/checks/aws_s3_limits b/checks/aws_s3_limits
index b88158c..b857398 100644
--- a/checks/aws_s3_limits
+++ b/checks/aws_s3_limits
@@ -29,7 +29,7 @@ factory_settings['aws_s3_limits_default_levels'] = {
}
-def parse_aws_s3_limits(info):
+def parse_aws_s3_limits(info): # pylint: disable=function-redefined
return [(resource_key, resource_title, limit, amount, None)
for resource_key, resource_title, limit, amount in parse_aws(info)]
diff --git a/checks/aws_s3_requests b/checks/aws_s3_requests
index ac94b5b..3250f71 100644
--- a/checks/aws_s3_requests
+++ b/checks/aws_s3_requests
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
-def parse_aws_s3(info):
+def parse_aws_s3(info): # pylint: disable=function-redefined
parsed = _extract_aws_metrics_by_labels([
"AllRequests",
"GetRequests",
diff --git a/checks/bdtms_tape_info b/checks/bdtms_tape_info
index 6102d6f..9f47a7a 100644
--- a/checks/bdtms_tape_info
+++ b/checks/bdtms_tape_info
@@ -25,11 +25,11 @@
# Boston, MA 02110-1301 USA.
-def inventory_bdtms_tape_info(info):
+def inventory_bdtms_tape_info(info): # pylint: disable=function-redefined
return [(None, None)]
-def check_bdtms_tape_info(_no_item, _no_params, info):
+def check_bdtms_tape_info(_no_item, _no_params, info): # pylint:
disable=function-redefined
for name, value in zip(['Vendor', 'Product ID', 'Serial
Number', 'Software Revision'], info[0]):
yield 0, "%s: %s" % (name, value)
diff --git a/checks/bdtms_tape_status b/checks/bdtms_tape_status
index d036c6f..c93fb1a 100644
--- a/checks/bdtms_tape_status
+++ b/checks/bdtms_tape_status
@@ -25,11 +25,11 @@
# Boston, MA 02110-1301 USA.
-def inventory_bdtms_tape_info(info):
+def inventory_bdtms_tape_info(info): # pylint: disable=function-redefined
return [(None, None)]
-def check_bdtms_tape_info(_no_item, _no_params, info):
+def check_bdtms_tape_info(_no_item, _no_params, info): # pylint:
disable=function-redefined
_activity_id, health_id = info[0]
health = {
diff --git a/checks/df.include b/checks/df.include
index 4ab5af7..dfeed90 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -29,7 +29,7 @@
# between include files are possible this will not be necessary anymore.
if 'size_trend' not in globals():
- def size_trend(*_args, **_kwargs):
+ def size_trend(*_args, **_kwargs): # pylint: disable=function-redefined
raise MKGeneralException('Function size_trend not found. Please include
'
'"size_trend.include" in your check')
diff --git a/checks/docker_container_status b/checks/docker_container_status
index 13e7b3a..e5cd0fb 100644
--- a/checks/docker_container_status
+++ b/checks/docker_container_status
@@ -26,7 +26,7 @@
# TODO: see why it's not enough to have it in legacy_docker.include
-def append_deprecation_warning(check_function):
+def append_deprecation_warning(check_function): # pylint: disable=function-redefined
'''A wrapper to WARN if legacy code is used
If the parse result is of one of the legacy Types the decorated
diff --git a/checks/docker_node_disk_usage b/checks/docker_node_disk_usage
index a4be887..7b564f0 100644
--- a/checks/docker_node_disk_usage
+++ b/checks/docker_node_disk_usage
@@ -26,7 +26,7 @@
# TODO: see why it's not enough to have it in legacy_docker.include
-def append_deprecation_warning(check_function):
+def append_deprecation_warning(check_function): # pylint: disable=function-redefined
'''A wrapper to WARN if legacy code is used
If the parse result is of one of the legacy Types the decorated
diff --git a/checks/docker_node_info b/checks/docker_node_info
index 41766c9..56a4324 100644
--- a/checks/docker_node_info
+++ b/checks/docker_node_info
@@ -26,7 +26,7 @@
# TODO: see why it's not enough to have it in legacy_docker.include
-def append_deprecation_warning(check_function):
+def append_deprecation_warning(check_function): # pylint: disable=function-redefined
'''A wrapper to WARN if legacy code is used
If the parse result is of one of the legacy Types the decorated
diff --git a/checks/filestats b/checks/filestats
index 88e4f8a..ddc441d 100644
--- a/checks/filestats
+++ b/checks/filestats
@@ -168,7 +168,6 @@ def check_filestats(_item, params, data):
yield subresult
-# pylint: disable=undefined-variable
check_info['filestats'] = {
"parse_function": parse_filestats,
"inventory_function": discover(),
diff --git a/checks/legacy_docker.include b/checks/legacy_docker.include
index e114f63..365f621 100644
--- a/checks/legacy_docker.include
+++ b/checks/legacy_docker.include
@@ -36,7 +36,7 @@ class DeprecatedList(list):
pass
-def append_deprecation_warning(check_function):
+def append_deprecation_warning(check_function): # pylint: disable=function-redefined
'''A wrapper to WARN if legacy code is used
If the parse result is of one of the legacy Types the decorated
diff --git a/checks/size_trend.include b/checks/size_trend.include
index 2f0d37b..0a31785 100644
--- a/checks/size_trend.include
+++ b/checks/size_trend.include
@@ -25,8 +25,7 @@
# Boston, MA 02110-1301 USA.
-# pylint: disable=function-redefined
-def size_trend(check, item, resource, levels, used_mb, size_mb, timestamp=None):
+def size_trend(check, item, resource, levels, used_mb, size_mb, timestamp=None): #
pylint: disable=function-redefined
"""Trend computation for size related checks of disks, ram, etc.
Trends are computed in two steps. In the first step the delta to
the last check is computed, using a normal check_mk counter.
diff --git a/cmk_base/check_api.py b/cmk_base/check_api.py
index 3258bae..78dd0a7 100644
--- a/cmk_base/check_api.py
+++ b/cmk_base/check_api.py
@@ -91,18 +91,17 @@ Global variables:
# concatenates lots of files, including this one.
# We import several modules here for the checks
-# pylint: disable=unused-import
# TODO: Move imports directly to checks?
-import collections
-import enum
-import fnmatch
+import collections # pylint: disable=unused-import
+import enum # pylint: disable=unused-import
+import fnmatch # pylint: disable=unused-import
import functools
-import math
+import math # pylint: disable=unused-import
import os
-import re
-import socket
-import sys
+import re # pylint: disable=unused-import
+import socket # pylint: disable=unused-import
+import sys # pylint: disable=unused-import
import time
# NOTE: We do not use pprint in this module, but it is part of the check API.
import pprint # pylint: disable=unused-import
@@ -115,7 +114,7 @@ import cmk.utils.debug as _debug
import cmk.utils.defines as _defines
import cmk.utils.paths as _paths
from cmk.utils.exceptions import MKGeneralException
-from cmk.utils.regex import regex
+from cmk.utils.regex import regex # pylint: disable=unused-import
import cmk.utils.render as render
# These imports are not meant for use in the API. So we prefix the names
@@ -123,7 +122,7 @@ import cmk.utils.render as render
# check context.
import cmk_base.utils as _utils
import cmk_base.config as _config
-import cmk_base.console as _console
+import cmk_base.console as _console # pylint: disable=unused-import
import cmk_base.snmp_utils as _snmp_utils
import cmk_base.item_state as _item_state
import cmk_base.prediction as _prediction
diff --git a/inventory/docker_container_labels b/inventory/docker_container_labels
index 197f692..d8b6195 100644
--- a/inventory/docker_container_labels
+++ b/inventory/docker_container_labels
@@ -24,8 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# pylint: disable=undefined-variable
-
def parse_docker_container_labels(info):
version = docker_get_version(info)