Module: check_mk
Branch: master
Commit: 5e4a602d120e9ee78eaf3b9220284406637c4898
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e4a602d120e9e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri May 13 15:34:11 2016 +0200
Use TAB as separator for 'plain' format. Fixed serialization.
---
bin/mkeventd | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/bin/mkeventd b/bin/mkeventd
index f060feb..400d616 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -757,6 +757,8 @@ def to_utf8(x):
def quote_tab(col):
if type(col) in [ float, int ]:
return str(col)
+ elif type(col) == bool:
+ return col and "1" or "0"
elif type(col) in [ tuple, list ]:
col = "\1" + "\1".join(map(to_utf8, col))
elif col == None:
@@ -2669,13 +2671,8 @@ class StatusServer:
raise MKClientError("Invalid method %s (allowed are GET, COMMAND and
REPLICATE)" % method)
if output_format == "plain":
- def format_column(value):
- try:
- return value.encode("utf-8")
- except Exception, e:
- return repr(value)
for line in response:
- socket.send("\x02".join(map(lambda x: format_column(x),
line)))
+ socket.send("\t".join([to_utf8(quote_tab(c)) for c in line]))
socket.send("\n")
else:
socket.send(repr(response))