Skip to content
Permalink
Browse files

Discovery check: Fall back to default parameters

When the check is enabled there should always be a rule and None should
never occur, but just to be sure we apply the default parameters.

Change-Id: I5a1d7058e1f6a30ccc50a3d8cb28cc54b2d12067
  • Loading branch information...
LarsMichelsen committed Jun 7, 2019
1 parent b688f07 commit c703e99f2de3777282621a70c689a3f4c4a4982a
Showing with 4 additions and 2 deletions.
  1. +2 −2 cmk_base/config.py
  2. +2 −0 cmk_base/discovery.py
@@ -2359,11 +2359,11 @@ def discovery_check_parameters(self):
"""
entries = self._config_cache.host_extra_conf(self.hostname, periodic_discovery)
if not entries:
return self._default_discovery_check_parameters()
return self.default_discovery_check_parameters()

return entries[0]

def _default_discovery_check_parameters(self):
def default_discovery_check_parameters(self):
"""Support legacy single value global configurations. Otherwise return the defaults"""
return {
"check_interval": inventory_check_interval,
@@ -329,6 +329,8 @@ def check_discovery(hostname, ipaddress):
host_config = config_cache.get_host_config(hostname)

params = host_config.discovery_check_parameters
if params is None:
params = host_config.default_discovery_check_parameters()

status = 0
infotexts = []

0 comments on commit c703e99

Please sign in to comment.
You can’t perform that action at this time.