summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 18:40:33 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:36 +0200
commit5eecc854236f0b943aaa89e0c3a46f9fbd208ca9 (patch)
tree89ae34b70f5a32f22b301ec9e4db363e046737cd /source4/scripting/python
parent957801fcb0c81317c84d448f1e04d069216f07ac (diff)
downloadsamba-5eecc854236f0b943aaa89e0c3a46f9fbd208ca9.tar.gz
samba-5eecc854236f0b943aaa89e0c3a46f9fbd208ca9.tar.bz2
samba-5eecc854236f0b943aaa89e0c3a46f9fbd208ca9.zip
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>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/samba3.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py
index 2c323bd0b4..ae5b20edd2 100644
--- a/source4/scripting/python/samba/samba3.py
+++ b/source4/scripting/python/samba/samba3.py
@@ -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):