From d9d196798945bef7a955acb8b71820800455be17 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Fri, 4 May 2012 10:34:00 -0400 Subject: Redo boolean value encoding. Move the code for encoding boolean values to LDAP boolean syntax from the Parameter class to the Encoder class, where the rest of LDAP encoding takes place. Remove encoding code from the Parameter class altogether, as all LDAP encoding should be done in the Encoder class. --- ipaserver/plugins/ldap2.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'ipaserver/plugins/ldap2.py') diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index ddef8dff..6a3d2164 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -59,7 +59,6 @@ except ImportError: from ldap.functions import explode_dn from ipalib.dn import DN from ipalib import _ -from ipalib.parameters import Bool import krbV @@ -76,23 +75,6 @@ MEMBERS_INDIRECT = 2 # SASL authentication mechanism SASL_AUTH = _ldap_sasl.sasl({}, 'GSSAPI') -# OID 1.3.6.1.4.1.1466.115.121.1.7 (Boolean) syntax encoding -def _encode_bool(self, value): - def encode_bool_value(value): - if value is None: - return None - if value: - return u'TRUE' - return u'FALSE' - - if type(value) in (tuple, list): - return tuple(encode_bool_value(v) for v in value) - else: - return encode_bool_value(value) - -# set own Bool parameter encoder -Bool._encode = _encode_bool - class IPASimpleLDAPObject(SimpleLDAPObject): ''' This is a thin layer over SimpleLDAPObject which allows us to utilize -- cgit