Module: check_mk
Branch: master
Commit: b6fb9c2ca0f1ea458ea943fe5d90dbd91e114c3e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6fb9c2ca0f1ea…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 18 15:03:58 2012 +0100
*_contactgroups lists: Single group rules are all appended. When a list
is found as a value this first list is used exclusively. All other
matching rules are ignored
---
ChangeLog | 3 +++
modules/check_mk.py | 12 +++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f05e854..8f9f724 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1.1.13i3:
Core, Setup, etc.:
+ * *_contactgroups lists: Single group rules are all appended. When a list
+ is found as a value this first list is used exclusively. All other
+ matching rules are ignored
* cmk -d does now honor --cache and --no-tcp
* cmk -O/-R now uses omd re{start,load} core if using OMD
* FIX: setup.sh now setups up permissions for conf.d/wato
diff --git a/modules/check_mk.py b/modules/check_mk.py
index b331c5b..b099fc7 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1136,14 +1136,12 @@ def host_contactgroups_of(hostlist):
cgrs = []
for host in hostlist:
# host_contactgroups may take single values as well as
- # lists as item value. Of all list entries only the first
- # one is used. The single-contact-groups entries are all
- # recognized.
- first_list = True
+ # lists as item value. When a list is found only this list
+ # is used. The single-contact-group entries are skipped in
+ # this case.
for entry in host_extra_conf(host, host_contactgroups):
- if type(entry) == list and first_list:
- cgrs += entry
- first_list = False
+ if type(entry) == list:
+ return entry
else:
cgrs.append(entry)
return list(set(cgrs))