Module: check_mk
Branch: master
Commit: 064bf04044503d888dbe9bd96631814871eb566f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=064bf04044503d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 22 12:56:45 2015 +0200
Fixed exception on slave site when syncing to slave site
---
web/htdocs/wato.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9c31183..1870068 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5072,9 +5072,7 @@ def foreign_changes():
def log_entry(linkinfo, action, message, logfilename, user_id = None):
- if type(message) == unicode:
- message = message.encode("utf-8")
- message = message.strip()
+ message = make_utf8(message).strip()
# linkinfo is either a folder, or a hostname or None
if type(linkinfo) == dict and linkinfo[".path"] in g_folders:
@@ -5086,15 +5084,15 @@ def log_entry(linkinfo, action, message, logfilename, user_id =
None):
else:
link = ":" + linkinfo
- if user_id == None:
- user_id = config.user_id
+ if user_id == None and config.user_id != None:
+ user_id = config.user_id.encode("utf-8")
elif user_id == '':
user_id = '-'
log_file = log_dir + logfilename
make_nagios_directory(log_dir)
f = create_user_file(log_file, "ab")
- f.write("%d %s %s %s %s\n" % (int(time.time()), link,
user_id.encode("utf-8"), action, message))
+ f.write("%d %s %s %s %s\n" % (int(time.time()), link, user_id, action,
message))
def log_audit(linkinfo, what, message, user_id = None):