Proyecto

General

Perfil

« Anterior | Siguiente » 

Revisión 97

Añadiendo logging

Ver diferencias:

LdapConnection.py
result_set.append(result_data)
return result_set
except ldap.LDAPError, e:
print e
logging.getLogger().debug('LDAP error search')
"""result = con.search_s( base_dn, ldap.SCOPE_SUBTREE, filter, attrs )
return result"""
......
self.connection.add_s(baseDN+",dc=instituto,dc=extremadura,dc=es", attr)
except ldap.ALREADY_EXISTS:
print "already exists"
logging.getLogger().debug("LDAP already exists %s" % (baseDN))
except ldap.OPERATIONS_ERROR:
print "error"
logging.getLogger().debug("LDAP operation error %s" % (baseDN))
except ldap.NO_SUCH_OBJECT:
print "no_such_object"
logging.getLogger().debug("LDAP no such object %s" % (baseDN))
return True

Exportar a: Unified diff