Skip to content
Permalink
Browse files

8851 FIX Fix broken "Parameters of X" for clustered services

The "Parameters of X" page always showed an exception like
"'list' object has no attribute 'check_plugin_name'".

Add type hints that would have prevented this issue.

FEED-4097

Change-Id: Ic21c97c4f563c0c1c84c2b5370b0b55e01b28daf
  • Loading branch information...
LarsMichelsen committed Aug 13, 2019
1 parent a74b816 commit 6550bbdf83036d754fd309863b21dfae7af6c36c
Showing with 16 additions and 3 deletions.
  1. +12 −0 .werks/8851
  2. +4 −3 cmk_base/automations/check_mk.py
@@ -0,0 +1,12 @@
Title: Fix broken "Parameters of X" for clustered services
Level: 1
Component: wato
Class: fix
Compatible: compat
Edition: cre
State: unknown
Version: 1.7.0i1
Date: 1565712910

The "Parameters of X" page always showed an exception like
"'list' object has no attribute 'check_plugin_name'".
@@ -573,6 +573,7 @@ def execute(self, args):
# TODO: Was ist mit Clustern???
# TODO: Klappt das mit automatischen verschatten von SNMP-Checks (bei dual Monitoring)
def _get_service_info(self, config_cache, host_config, servicedesc):
# type: (config.ConfigCache, config.HostConfig, Text) -> Dict
hostname = host_config.hostname
check_api_utils.set_hostname(hostname)

@@ -601,12 +602,12 @@ def _get_service_info(self, config_cache, host_config, servicedesc):
# TODO: There is a lot of duplicated logic with discovery.py/check_table.py. Clean this
# whole function up.
if host_config.is_cluster:
services = []
for node in host_config.nodes:
services = [] # type: List[cmk_base.check_utils.Service]
for node in host_config.nodes or []:
for service in config_cache.get_autochecks_of(node):
if hostname == config_cache.host_of_clustered_service(
node, service.description):
services.append(services)
services += services
else:
services = config_cache.get_autochecks_of(hostname)

0 comments on commit 6550bbd

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