Fix hanlding errors logging
This commit is contained in:
parent
b9a859c801
commit
66df317940
1 changed files with 5 additions and 5 deletions
|
@ -85,7 +85,7 @@ class LdapServer(object):
|
||||||
self.con.add_s(dn,ldif)
|
self.con.add_s(dn,ldif)
|
||||||
return True
|
return True
|
||||||
except ldap.LDAPError, e:
|
except ldap.LDAPError, e:
|
||||||
self._error("LdapServer - Error adding %s : %s" % (dn,e), logging.error)
|
self._error("LdapServer - Error adding %s : %s" % (dn,e), logging.ERROR)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class LdapServer(object):
|
||||||
self.con.modify_s(dn,ldif)
|
self.con.modify_s(dn,ldif)
|
||||||
return True
|
return True
|
||||||
except ldap.LDAPError, e:
|
except ldap.LDAPError, e:
|
||||||
self._error("LdapServer - Error updating %s : %s\nOld : %s\nNew : %s" % (dn, e, old, new), logging.error)
|
self._error("LdapServer - Error updating %s : %s\nOld : %s\nNew : %s" % (dn, e, old, new), logging.ERROR)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def update_need(self, old, new, ignore_attrs=[]):
|
def update_need(self, old, new, ignore_attrs=[]):
|
||||||
|
@ -112,7 +112,7 @@ class LdapServer(object):
|
||||||
self.con.rename_s(dn,new_rdn)
|
self.con.rename_s(dn,new_rdn)
|
||||||
return True
|
return True
|
||||||
except ldap.LDAPError, e:
|
except ldap.LDAPError, e:
|
||||||
self._error("LdapServer - Error renaming %s in %s : %s" % (dn,new_rdn,e), logging.error)
|
self._error("LdapServer - Error renaming %s in %s : %s" % (dn,new_rdn,e), logging.ERROR)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ class LdapServer(object):
|
||||||
self.con.delete_s(dn)
|
self.con.delete_s(dn)
|
||||||
return True
|
return True
|
||||||
except ldap.LDAPError, e:
|
except ldap.LDAPError, e:
|
||||||
self._error("LdapServer - Error deleting %s : %s" % (dn,e), logging.error)
|
self._error("LdapServer - Error deleting %s : %s" % (dn,e), logging.ERROR)
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue