kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.1k stars 364 forks source link

Setting guest permissions for ldap users not possible #1268

Open maikgreubel opened 5 years ago

maikgreubel commented 5 years ago

In case of ldap objects readen from activate directory machine containing country specific data, storing of permission on guest is not possible. Log shows

  File "/opt/python27/lib/python2.7/site-packages/wok/plugins/kimchi/control/users.py", line 37, in get
    return render(get_class_name(self), res_list)
  File "/opt/python27/lib/python2.7/site-packages/wok/template.py", line 127, in render
    return json.dumps(data, indent=2, separators=(',', ':'))
  File "/opt/python27/lib/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/opt/python27/lib/python2.7/json/encoder.py", line 209, in encode
    chunks = list(chunks)
  File "/opt/python27/lib/python2.7/json/encoder.py", line 434, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/opt/python27/lib/python2.7/json/encoder.py", line 408, in _iterencode_dict
    for chunk in chunks:
  File "/opt/python27/lib/python2.7/json/encoder.py", line 313, in _iterencode_list
    yield buf + _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9a in position 14: invalid start byte

I have no glue, in which codepage the object is stored, but we are in Germany, so Win1252 seems legit.

The line in wok/plugins/kimchi/control/users.py has changed because I inserted some debugging code before the render function. You can subtract 3 lines.