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:
@ -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):
|
||||
|
Reference in New Issue
Block a user