Open whitlockjc opened 8 years ago
Unbind alone does not work since the server is busy. Adding a loop to retry when unbinding worked:
for i in range(1, 3):
try:
groups = search_for_groups(ldapobject)
break
except ldap.LDAPError, error_message:
print("Error performing search: %s " % error_message)
if i==3:
unbind(ldapobject)
sys.exit(1)
I am using your script on CentOS 6. I got the following error when using your script more then once: Error performing search:
{'info': '00002024: LdapErr: DSID-0C060595, comment: No other operations may be performed on the connection while a bind is outstanding., data 0, v1772', 'desc': 'Server is busy'}
It seems the binding is not released by your script. I added anunbind
function. Since I'm unfamiliar with Bitbucket here are the relevant snippets.Cheers, Jasper