From 3b613091bbc952e03ae73640311a8136f40a95ff Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Wed, 8 Jul 2009 17:11:02 +0200 Subject: Import explode_dn from ldap.functions for backward compatibility with older version of python-ldap. Fix bug in add_entry_to_group. Resolves 510149 --- ipaserver/plugins/ldap2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ipaserver') diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index 43cc6b976..a904afaa1 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -38,6 +38,8 @@ import ldap.filter as _ldap_filter import ldap.sasl as _ldap_sasl from ldap.controls import LDAPControl from ldap.ldapobject import SimpleLDAPObject +# for backward compatibility +from ldap.functions import explode_dn from ipalib import api, errors from ipalib.crud import CrudBackend @@ -235,7 +237,7 @@ class ldap2(CrudBackend, Encoder): Note: You don't have to normalize DN's before passing them to ldap2 methods. It's done internally for you. """ - rdns = _ldap.dn.explode_dn(dn) + rdns = explode_dn(dn) if rdns: dn = ','.join(rdns) if not dn.endswith(self.api.env.basedn): @@ -577,7 +579,7 @@ class ldap2(CrudBackend, Encoder): if dn == group_dn: raise errors.SameGroupError() # check if the entry exists - (dn, entry_attrs) = self.get_entry(dn, ['objectclass'], ['']) + (dn, entry_attrs) = self.get_entry(dn, ['objectclass']) # get group entry (group_dn, group_entry_attrs) = self.get_entry(group_dn, [member_attr]) -- cgit