Module: check_mk
Branch: master
Commit: ed48717255a276651194043a124bb1daa886e05f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ed48717255a276…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Apr 16 07:07:18 2019 +0200
fix typo
Change-Id: Ibc7f60082b6f7d747aafe767658d9dc45ef036f6
---
.werks/7143 | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.werks/7143 b/.werks/7143
index 91b885f..4110ca3 100644
--- a/.werks/7143
+++ b/.werks/7143
@@ -16,14 +16,14 @@ If you where using both plugins, you can use the new plugin in its
default configuration to replace them. If you have been using only
one of them, you can disable the opposite parts of the new plugin,
either by using the bakery rule "Docker node and containers" or via
-the configuration file (please refer to the example files in
-agents/cfg_examples fo rmore details).
+the configuration file (please refer to the example files in
+agents/cfg_examples for more details).
The previous rule "Piggybacked docker containers" is deprecated -
please set up a corresponding new one.
To deploy this plugin you must have the 'docker-py' python library
-installed on the monitored system. You can install it using the
+installed on the monitored system. You can install it using the
python package manager pip (using the shell command
"pip install docker-py").
Module: check_mk
Branch: master
Commit: 19e6695ab6757b8536468e94c9a89a80528d48dc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19e6695ab6757b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 15 15:51:55 2019 +0200
7338 FIX Dropped ancient "no_discovery_possible" from check API
The function no_discovery_possible was provided by the check API in the early days
were the check_info was declared as 3-element tuple. Since the checks are registered
as dictionaries this function is not needed anymore.
In case you get an issue with this after an update, you will have to migrate your
checks to the current check_info syntax.
Change-Id: Ied704a41cba892368f02f766af4c86999ddb3ab3
---
.werks/7338 | 15 +++++++++++++++
cmk_base/check_api.py | 9 ---------
cmk_base/check_api_utils.py | 14 --------------
cmk_base/config.py | 2 --
cmk_base/discovery.py | 7 ++++++-
5 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/.werks/7338 b/.werks/7338
new file mode 100644
index 0000000..19a827b
--- /dev/null
+++ b/.werks/7338
@@ -0,0 +1,15 @@
+Title: Dropped ancient "no_discovery_possible" from check API
+Level: 1
+Component: core
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1555336187
+Class: fix
+
+The function no_discovery_possible was provided by the check API in the early days
+were the check_info was declared as 3-element tuple. Since the checks are registered
+as dictionaries this function is not needed anymore.
+
+In case you get an issue with this after an update, you will have to migrate your
+checks to the current check_info syntax.
diff --git a/cmk_base/check_api.py b/cmk_base/check_api.py
index 78dd0a7..8ecf4da 100644
--- a/cmk_base/check_api.py
+++ b/cmk_base/check_api.py
@@ -201,15 +201,6 @@ def savefloat(f):
return 0.0
-# The function no_discovery_possible is as stub function used for
-# those checks that do not support inventory. It must be known before
-# we read in all the checks
-#
-# TODO: This seems to be an old part of the check API and not used for
-# a long time. Deprecate this as part of the and move it to the
-# cmk_base.config module.
-no_discovery_possible = _check_api_utils.no_discovery_possible
-
service_extra_conf = _config.service_extra_conf
host_extra_conf = _config.host_extra_conf
in_binary_hostlist = _config.in_binary_hostlist
diff --git a/cmk_base/check_api_utils.py b/cmk_base/check_api_utils.py
index 3c33c2f..9e47398 100644
--- a/cmk_base/check_api_utils.py
+++ b/cmk_base/check_api_utils.py
@@ -29,23 +29,9 @@
# But at the current state of affairs we have no choice, otherwise an
# incremental cleanup is impossible.
-import cmk_base.console as console
-
# Symbolic representations of states in plugin output
state_markers = ["", "(!)", "(!!)", "(?)"]
-
-# The function no_discovery_possible is as stub function used for
-# those checks that do not support inventory. It must be known before
-# we read in all the checks
-def no_discovery_possible(check_plugin_name, info):
- """In old checks we used this to declare that a check did not support
- a service discovery. Please don't use this for new checks. Simply
- skip the "inventory_function" argument of the check_info declaration."""
- console.verbose("%s does not support discovery. Skipping it.\n", check_plugin_name)
- return []
-
-
# Management board checks
MGMT_ONLY = "mgmt_only" # Use host address/credentials when it's a SNMP HOST
HOST_PRECEDENCE = "host_precedence" # Check is only executed for mgmt board (e.g. Managegment Uptime)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index bea4422..0ac0ee0 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -2279,8 +2279,6 @@ def convert_check_info():
if not isinstance(info, dict):
# Convert check declaration from old style to new API
check_function, descr, has_perfdata, inventory_function = info
- if inventory_function == check_api_utils.no_discovery_possible:
- inventory_function = None
scan_function = snmp_scan_functions.get(check_plugin_name,
snmp_scan_functions.get(section_name))
diff --git a/cmk_base/discovery.py b/cmk_base/discovery.py
index 3ca66c2..04a77e8 100644
--- a/cmk_base/discovery.py
+++ b/cmk_base/discovery.py
@@ -854,11 +854,16 @@ def _get_discovery_function_of(check_plugin_name):
raise MKGeneralException("No such check type '%s'" % check_plugin_name)
if discovery_function is None:
- return check_api_utils.no_discovery_possible
+ return lambda _info: _no_discovery_possible(check_plugin_name)
return discovery_function
+def _no_discovery_possible(check_plugin_name):
+ console.verbose("%s does not support discovery. Skipping it.\n", check_plugin_name)
+ return []
+
+
def _execute_discovery_function(discovery_function, section_content):
discovered_items = discovery_function(section_content)