From 4702e7b78fde9845d77c31d32e0de25b0abfb5bc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 18 May 2016 09:37:37 +0200 Subject: Normalize objectclass attribute values (#5423) Summary: Fixes objectclass member comparison in cmd-sync #5423 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen, vendel.colja Differential Revision: https://git.kolab.org/D156 --- pykolab/utils.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pykolab/utils.py b/pykolab/utils.py index 29a0e95..8bc82e5 100644 --- a/pykolab/utils.py +++ b/pykolab/utils.py @@ -394,6 +394,17 @@ def normalize(_object): if not result.has_key('domain') and result.has_key('standard_domain'): result['domain'] = result['standard_domain'] + if 'objectclass' not in result: + result['objectclass'] = [] + + if result['objectclass'] is None: + result['objectclass'] = [] + + if not isinstance(result['objectclass'], list): + result['objectclass'] = [result['objectclass']] + + result['objectclass'] = [x.lower() for x in result['objectclass']] + return result def parse_input(_input, splitchars= [ ' ' ]): -- cgit v1.1