Module: check_mk
Branch: master
Commit: 4aa144ccf5169962bd9670c7810f001f87f5673b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4aa144ccf51699…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 3 06:47:11 2011 +0100
Fixed bug that lost autochecks when using WATO and cmk -II together
---
.bugs/169 | 11 ++++++++---
ChangeLog | 4 ++++
modules/check_mk.py | 6 ++++--
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.bugs/169 b/.bugs/169
index 14a2eed..4ea7850 100644
--- a/.bugs/169
+++ b/.bugs/169
@@ -1,10 +1,11 @@
Title: WATO misses services
Component: wato
+State: done
+Class: bug
+Date: 2011-03-02 09:45:16
Benefit: 4
-State: open
Cost: 2
-Date: 2011-03-02 09:45:16
-Class: bug
+Fun: 0
In some strange cases WATO seems to loose services:
@@ -26,3 +27,7 @@ In some strange cases WATO seems to loose services:
services were legacy services that I had much earlier
added (globally)
via editing files.
+
+2011-03-03 06:48:36: changed state open -> done
+Was due to different quote types used in autochecks files.
+Should be fixed now.
diff --git a/ChangeLog b/ChangeLog
index c6a7fa7..88b7603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1.1.10b2:
+ WATO:
+ * FIX: Fixed bug that lost autochecks when using WATO and cmk -II together
+
1.1.10b1:
Core, Setup, etc.:
* FIX: do not assume 127.0.0.1 as IP address for usewalk_hosts if
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 266ce5b..0ec6f58 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1873,9 +1873,11 @@ def remove_autochecks_of(hostname, checktypes):
lines = []
count = 0
for line in file(fn):
- if line.lstrip().startswith('("'):
+ # hostname and check type can be quoted with ' or with "
+ double_quoted = line.replace("'", '"').lstrip()
+ if double_quoted.startswith('("'):
count += 1
- splitted = line.split('"')
+ splitted = double_quoted.split('"')
if splitted[1] != hostname or splitted[3] not in checktypes:
if splitted[3] not in check_info:
sys.stderr.write('Removing unimplemented check %s\n' %
splitted[3])