pyldb: Add ldb.disconnect() method to ensure DB handles are closed
authorAndrew Bartlett <abartlet@samba.org>
Tue, 5 Dec 2023 22:18:27 +0000 (11:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 05:13:32 +0000 (05:13 +0000)
commitfdc3212275bc08f4a016e10923e689192ea7697f
tree9744cd9c8098c4cce19aca3d377a6efdc59a6e3d
parent784ee21616a60993ecc0979f83fbb04467d57af9
pyldb: Add ldb.disconnect() method to ensure DB handles are closed

This is vital in our backup code, which needs to actually close the
LMDB at the correct point.

The Python ldb object itself is left in more or less the same state as
one that has not connected to a server or database (it is a very
simple wrapper in itself), and can be reconnected using the .connect()
method.

Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
lib/ldb/pyldb.c