From 785e13dd1e16ad03d4ef03edcb672d6f9d8b457b Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 24 Jul 2014 17:17:48 +0200 Subject: [PATCH] Exclude attributelevelrights from --raw result processing in baseldap. https://fedorahosted.org/freeipa/ticket/4371 Reviewed-By: Petr Viktorin --- ipalib/plugins/baseldap.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 865a357bb..26b43b90d 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -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')