Hi, MuS.
I had the same problem as Akkano, I took a look to your myldap.py and definitely I think there's a problem in the loop where you compose the result:
# get and process the LDAP result
try: # lets do it
if myDebug == "yes": logger.info( "processing LDAP results..." ) # logger
while 1: # start the loop
result_type, result_data = l.result(result_id,0) # get the type and data from the results
result_set = result_set + result_data # append result data to the set
if (result_data == []): # if there is no more result
break # leave the while loop
for i in result_set: # do some python Fu magic on the LDAP results
a = {} # set empty list
z = {} # set empty list
key = "dn" # set key to DN to identify the destinguest name
z.setdefault(key, []) #
z[key].append(i[0]) #
for k, v in i[1].items(): #
if not k == "objectClass": #
v = '","'.join(v) #
key = k #
a.setdefault(key, []) #
a[key].append(v) # append keys and value pairs to first list
z = dict(z.items() + a.items()) # append keys and value pairs to second list
od = collections.OrderedDict(sorted(z.items())) # lets sort this alphabetical order
results.append(od) # append ordered list to results
Without a deep analysis, it looks to me that at some point you where just returning the "result_set" variable, but now what you return is "results" which should be appended with "results_data" in each iteration (hence everything works with the change suggested by Akkano, that is making "result_set = result_data" in each iteration).
Anyway, this workaround is ugly and I'd love to see your better approach in the next release... or I could help if you are too busy.
Thank you!
Rober
... View more