summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2006-04-30 00:38:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:05:21 -0500
commitb729cc821123ff48b8c4d06d59ee0c0d00f070ba (patch)
treea946f71547f29830d4f5666652c87d7624d7e0bb /source4/lib/ldb
parent1bf908c06204c9ff2edbc45eb363e1ef325e7e6d (diff)
downloadsamba-b729cc821123ff48b8c4d06d59ee0c0d00f070ba.tar.gz
samba-b729cc821123ff48b8c4d06d59ee0c0d00f070ba.tar.bz2
samba-b729cc821123ff48b8c4d06d59ee0c0d00f070ba.zip
r15343: Some small cleanups.
Remove LdbMessage.close() method as it's not necessary. (This used to be commit c9ed165c17f1e74e0c6c04569936fbfb08f6c9ed)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/swig/Ldb.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/lib/ldb/swig/Ldb.py b/source4/lib/ldb/swig/Ldb.py
index 099fbcd6e0..d00b2b0be1 100644
--- a/source4/lib/ldb/swig/Ldb.py
+++ b/source4/lib/ldb/swig/Ldb.py
@@ -29,10 +29,16 @@ result = ldb_global_init()
if result != 0:
raise LdbError, (result, 'ldb_global_init failed')
+# Ldb exceptions
+
class LdbError(Exception):
- """An exception raised when a ldb error occurs."""
+ """An exception raised when a ldb error occurs.
+ The exception data is a tuple consisting of the ldb number and a
+ string description of the error."""
pass
+# Ldb classes
+
class LdbMessage:
"""A class representing a ldb message as a Python dictionary."""
@@ -41,9 +47,6 @@ class LdbMessage:
self.msg = ldb_msg_new(self.mem_ctx)
def __del__(self):
- self.close()
-
- def close(self):
if self.mem_ctx is not None:
talloc_free(self.mem_ctx)
self.mem_ctx = None
@@ -88,7 +91,7 @@ class Ldb:
self.mem_ctx = talloc_init('mem_ctx for ldb 0x%x' % id(self))
self.ldb_ctx = ldb_init(self.mem_ctx)
- result = ldb_connect(self.ldb_ctx, url, flags, None)
+ result = ldb_connect(self.ldb_ctx, url, flags, None)
if result != LDB_SUCCESS:
raise LdbError, (result, ldb_strerror(result))