Fix attempted write to attribute of read-only object.

Add new class "cachedproperty" for creating property-like attributes
that cache the return value of a method call.

Also fix few issues in the unit tests to enable them to succeed.

ticket 1959
This commit is contained in:
Jan Cholasta
2012-01-02 11:51:26 +03:00
committed by Alexander Bokovoy
parent 46d3abc450
commit 9beb467d98
9 changed files with 55 additions and 17 deletions
+1 -1
View File
@@ -210,7 +210,7 @@ def _handle_errors(e, **kw):
raise errors.DuplicateEntry()
except _ldap.CONSTRAINT_VIOLATION:
# This error gets thrown by the uniqueness plugin
if info == 'Another entry with the same attribute value already exists':
if info.startswith('Another entry with the same attribute value already exists'):
raise errors.DuplicateEntry()
else:
raise errors.DatabaseError(desc=desc, info=info)