- Timestamp:
- 10/24/03 10:37:55 (21 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1168 r1170 22 22 PyKota NEWS : 23 23 24 - 1.16alpha1 : 25 26 - Ensures that the LDAP connection is really closed at end. 27 28 - More complete error messages in case of LDAP operation failure. 29 24 30 - 1.15 : 25 31 -
pykota/trunk/pykota/storages/ldapstorage.py
r1149 r1170 22 22 # 23 23 # $Log$ 24 # Revision 1.34 2003/10/24 08:37:55 jalet 25 # More complete messages in case of LDAP failure. 26 # LDAP database connection is now unbound on exit too. 27 # 24 28 # Revision 1.33 2003/10/08 07:01:20 jalet 25 29 # Job history can be disabled. … … 176 180 """Closes the database connection.""" 177 181 if not self.closed : 178 del self.database182 self.database.unbind_s() 179 183 self.closed = 1 180 184 self.tool.logdebug("Database closed.") … … 205 209 self.tool.logdebug("QUERY : Filter : %s, BaseDN : %s, Scope : %s, Attributes : %s" % (key, base, scope, fields)) 206 210 result = self.database.search_s(base or self.basedn, scope, key, fields) 207 except ldap.LDAPError :208 raise PyKotaStorageError, _("Search for %s(%s) from %s(scope=%s) returned no answer.") % (key, fields, base, scope)211 except ldap.LDAPError, msg : 212 raise PyKotaStorageError, (_("Search for %s(%s) from %s(scope=%s) returned no answer.") % (key, fields, base, scope)) + " : %s" % str(msg) 209 213 else : 210 214 self.tool.logdebug("QUERY : Result : %s" % result) … … 216 220 self.tool.logdebug("QUERY : ADD(%s, %s)" % (dn, str(fields))) 217 221 self.database.add_s(dn, modlist.addModlist(fields)) 218 except ldap.LDAPError :219 raise PyKotaStorageError, _("Problem adding LDAP entry (%s, %s)") % (dn, str(fields))222 except ldap.LDAPError, msg : 223 raise PyKotaStorageError, (_("Problem adding LDAP entry (%s, %s)") % (dn, str(fields))) + " : %s" % str(msg) 220 224 else : 221 225 return dn … … 226 230 self.tool.logdebug("QUERY : Delete(%s)" % dn) 227 231 self.database.delete_s(dn) 228 except ldap.LDAPError :229 raise PyKotaStorageError, _("Problem deleting LDAP entry (%s)") % dn232 except ldap.LDAPError, msg : 233 raise PyKotaStorageError, (_("Problem deleting LDAP entry (%s)") % dn) + " : %s" % str(msg) 230 234 231 235 def doModify(self, dn, fields, ignoreold=1) : … … 235 239 self.tool.logdebug("QUERY : Modify(%s, %s ==> %s)" % (dn, oldentry[0][1], fields)) 236 240 self.database.modify_s(dn, modlist.modifyModlist(oldentry[0][1], fields, ignore_oldexistent=ignoreold)) 237 except ldap.LDAPError :238 raise PyKotaStorageError, _("Problem modifying LDAP entry (%s, %s)") % (dn, fields)241 except ldap.LDAPError, msg : 242 raise PyKotaStorageError, (_("Problem modifying LDAP entry (%s, %s)") % (dn, fields)) + " : %s" % str(msg) 239 243 else : 240 244 return dn -
pykota/trunk/pykota/version.py
r1168 r1170 22 22 # 23 23 24 __version__ = "1.1 5_unofficial"24 __version__ = "1.16alpha1_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""