diff options
author | Jan Cholasta <jcholast@redhat.com> | 2012-05-04 10:34:00 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-05-09 09:43:35 +0200 |
commit | d9d196798945bef7a955acb8b71820800455be17 (patch) | |
tree | fcdbbb63b26640f9255a264b62d53248e8e11ba1 /ipaserver/plugins/ldap2.py | |
parent | abef5e8c027bf37d9522f4d30e8e43c408251893 (diff) | |
download | freeipa-d9d196798945bef7a955acb8b71820800455be17.tar.gz freeipa-d9d196798945bef7a955acb8b71820800455be17.tar.xz freeipa-d9d196798945bef7a955acb8b71820800455be17.zip |
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.
Diffstat (limited to 'ipaserver/plugins/ldap2.py')
-rw-r--r-- | ipaserver/plugins/ldap2.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index ddef8dffc..6a3d2164e 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 |