Changeset 2751 for pykota

Show
Ignore:
Timestamp:
02/23/06 14:44:00 (19 years ago)
Author:
jerome
Message:

Logs something instead of failing when an entry to delete is missing : normal case if you delete printers and users at the same time in two different xterms.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2750 r2751  
    192192                self.database.add_s(dn, entry) 
    193193            except ldap.ALREADY_EXISTS, msg :         
    194                 raise PyKotaStorageError 
     194                raise PyKotaStorageError, "Entry %s already exists : %s" % (dn, str(msg)) 
    195195            except ldap.LDAPError, msg : 
    196196                message = (_("Problem adding LDAP entry (%s, %s)") % (dn, str(fields))) + " : %s" % str(msg) 
     
    213213                self.tool.logdebug("QUERY : Delete(%s)" % dn) 
    214214                self.database.delete_s(dn) 
     215            except ldap.NO_SUCH_OBJECT :     
     216                self.tool.printInfo("Entry %s was already missing before we deleted it. This **MAY** be normal." % dn, "info") 
    215217            except ldap.LDAPError, msg : 
    216218                message = (_("Problem deleting LDAP entry (%s)") % dn) + " : %s" % str(msg)