Module: check_mk
Branch: master
Commit: 69c012cebddc60d231a0e896a8bcd00ebbf255f2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69c012cebddc60…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 19 15:45:02 2016 +0100
Fix exception in parsing of autochecks if item contains quote
---
.bugs/2172 | 7 ++++---
.bugs/2173 | 2 +-
.bugs/856 | 2 +-
modules/discovery.py | 5 +++--
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/.bugs/2172 b/.bugs/2172
index 02887fb..eb6926b 100644
--- a/.bugs/2172
+++ b/.bugs/2172
@@ -5,6 +5,7 @@ Date: 2015-03-04 09:42:59
Targetversion: 1.2.7
Class: bug
-Currently in all saved userfiles unicode strings are converted to utf-8 encoding ascii
strings.
-These strings are not converted back to unicode strings during load_user_file(..).
-All strings with umlauts need to be unicode strings within multisite code.
+Currently in all saved userfiles unicode strings are converted to utf-8
+encoding ascii strings. These strings are not converted back to unicode
+strings during load_user_file(..). All strings with umlauts need to be
+unicode strings within multisite code.
diff --git a/.bugs/2173 b/.bugs/2173
index 694a51f..396ce5c 100644
--- a/.bugs/2173
+++ b/.bugs/2173
@@ -2,7 +2,7 @@ Title: WATO backup: Do not save configuration files which are derived from
omd c
Component: wato
State: open
Date: 2015-03-10 11:30:33
-Targetversion: 1.2.9
+Targetversion: future
Class: bug
Example:
diff --git a/.bugs/856 b/.bugs/856
index 2a0eadc..dbccba6 100644
--- a/.bugs/856
+++ b/.bugs/856
@@ -2,7 +2,7 @@ Title: Report scheduler doesn't pass "Group of Host" filter
to the report
Component: core
State: open
Date: 2015-12-15 16:20:50
-Targetversion: 1.2.7
+Targetversion: 1.2.8
Class: bug
If you create a Report with context "Hostgroup", add a View with Service
diff --git a/modules/discovery.py b/modules/discovery.py
index fc6e011..7ed492d 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -1135,7 +1135,7 @@ def parse_autochecks_file(hostname):
backslash = True
elif c == quote:
quote = None # end of quoted string
- elif c in [ '"', "'" ]:
+ elif c in [ '"', "'" ] and not quote:
quote = c # begin of quoted string
elif quote:
continue
@@ -1149,6 +1149,7 @@ def parse_autochecks_file(hostname):
value = line[0:i]
rest = line[i+1:]
return value.strip(), rest
+
return line.strip(), None
path = "%s/%s.mk" % (autochecksdir, hostname)
@@ -1186,7 +1187,7 @@ def parse_autochecks_file(hostname):
if len(parts) == 4:
parts = parts[1:] # drop hostname, legacy format with host in first
column
elif len(parts) != 3:
- raise Exception("Invalid number of parts: %d" % len(parts))
+ raise Exception("Invalid number of parts: %d (%r)" %
(len(parts), parts))
checktypestring, itemstring, paramstring = parts