Module: check_mk
Branch: master
Commit: aed3ce9144b391943bfed7440a77f265c0a9919e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aed3ce9144b391…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 13 10:23:42 2012 +0100
Fixed encoding problem in wato auth export hook
---
web/plugins/wato/auth.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/web/plugins/wato/auth.py b/web/plugins/wato/auth.py
index 05ca513..f850df2 100644
--- a/web/plugins/wato/auth.py
+++ b/web/plugins/wato/auth.py
@@ -71,8 +71,10 @@ def parse_php(data, lvl = 1):
for key, val in data.iteritems():
s += ' ' * lvl + parse_php(key, lvl + 1) + ' => ' +
parse_php(val, lvl + 1) + ',\n'
s += ' ' * (lvl - 1) + ')'
- elif isinstance(data, str) or isinstance(data, unicode):
+ elif isinstance(data, str):
s += '\'%s\'' % data
+ elif isinstance(data, unicode):
+ s += '\'%s\'' % data.encode('utf-8')
elif isinstance(data, bool):
s += data and 'true' or 'false'
elif data is None: