Use ldap_explode_dn instead of ldap_str2dn so we can use python-ldap 2.2.0

This commit is contained in:
Rob Crittenden committed 2008-02-11 09:42:47 -05:00
1 parent 5be3defccf
commit 0300952ec7
1 file changed
+4 -5
+4 -5
View File
@@ -151,12 +151,11 @@ def extract_group_cns(aci_list, client):
for aci in aci_list:
for dn in (aci.source_group, aci.dest_group):
if not group_dn_to_cn.has_key(dn):
rdn_list = ldap.dn.str2dn(dn)
rdn_list = ldap.explode_dn(dn, 0)
first_rdn = rdn_list[0]
for (type,value,junk) in first_rdn:
if type == "cn":
group_dn_to_cn[dn] = value
break;
(type,value) = first_rdn.split('=')
if type == "cn":
group_dn_to_cn[dn] = value
else:
try:
group = client.get_entry_by_dn(dn, ['cn'])