Module: check_mk
Branch: master
Commit: 8f5a7e44a9a12af8e163f65203abb669b0839c0f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f5a7e44a9a12a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 12 12:07:44 2011 +0200
FIX: fix crash when saving services after migration from old version
---
ChangeLog | 1 +
modules/check_mk.py | 8 ++++++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1b4848d..da59213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
* Added new component BI to Multisite.
WATO:
+ * FIX: fix crash when saving services after migration from old version
* Allow moving hosts from one to another config file
Checks & Agents:
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 189f944..440672c 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3684,6 +3684,14 @@ def automation_parse_autochecks_file(hostname):
line = line.strip()
if not line.startswith("("):
continue
+
+ # drop everything after potential '#' (from older versions)
+ i = line.rfind('#')
+ if i > 0: # make sure # is not contained in string
+ rest = line[i:]
+ if '"' not in rest and "'" not in rest:
+ line = line[:i].strip()
+
if line.endswith(","):
line = line[:-1]
line = line[1:-1] # drop brackets