1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-07 12:59:08 +03:00

tdb2: create tdb2 versions of various testing TDBs.

Soon, TDB2 will handle tdb1 files, but until then, we substitute.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2011-06-20 18:40:33 +09:30
parent 957801fcb0
commit 5eecc85423
13 changed files with 68 additions and 25 deletions

View File

@ -50,9 +50,12 @@ class TdbDatabase(object):
def __init__(self, file):
"""Open a file.
:param file: Path of the file to open.
:param file: Path of the file to open (appending "2" if TDB2 enabled).
"""
self.tdb = tdb.Tdb(file, flags=os.O_RDONLY)
if tdb.__version__.startswith("2"):
self.tdb = tdb.Tdb(file + "2", flags=os.O_RDONLY)
else:
self.tdb = tdb.Tdb(file, flags=os.O_RDONLY)
self._check_version()
def _check_version(self):