Exclude attributelevelrights from --raw result processing in baseldap.

https://fedorahosted.org/freeipa/ticket/4371

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
Jan Cholasta 2014-07-24 17:17:48 +02:00 committed by Petr Viktorin
parent 1313537736
commit 785e13dd1e

View File

@ -240,9 +240,13 @@ def entry_from_entry(entry, newentry):
def entry_to_dict(entry, **options):
if options.get('raw', False):
result = {}
for attr, value in entry.raw.iteritems():
if entry.conn.get_type(attr) is not str:
value = list(value)
for attr in entry.iterkeys():
if attr.lower() == 'attributelevelrights':
value = entry[attr]
elif entry.conn.get_type(attr) is str:
value = entry.raw[attr]
else:
value = list(entry.raw[attr])
for (i, v) in enumerate(value):
try:
value[i] = v.decode('utf-8')