diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-05-20 16:29:10 +1200 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-05-23 14:25:52 +0000 |
commit | 1a9da378a1505daff498be6d6355debd73526a1a (patch) | |
tree | 7a145d5b783240feafb389678555659e16c5fbf3 /source4 | |
parent | 3b608510e4be190d2aacf69dceefc937a25e10e7 (diff) | |
download | samba-1a9da378a1505daff498be6d6355debd73526a1a.tar.gz |
sambaundoguididx: Add flags=ldb.FLG_DONT_CREATE_DB and port to Python3
In py3 we need to add an extra str() around the returned ldb value to
enable .split() to be used.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed By: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu May 23 14:25:52 UTC 2019 on sn-devel-184
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/scripting/bin/sambaundoguididx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/scripting/bin/sambaundoguididx b/source4/scripting/bin/sambaundoguididx index 00fe63897b4..f67353ff361 100755 --- a/source4/scripting/bin/sambaundoguididx +++ b/source4/scripting/bin/sambaundoguididx @@ -34,7 +34,9 @@ if opts.H is None: else: url = opts.H -samdb = ldb.Ldb(url=url, options=["modules:"]) +samdb = ldb.Ldb(url=url, + flags=ldb.FLG_DONT_CREATE_DB, + options=["modules:"]) partitions = samdb.search(base="@PARTITION", scope=ldb.SCOPE_BASE, @@ -58,10 +60,11 @@ privatedir = os.path.dirname(url) dbs = [] for part in partitions[0]['partition']: - tdbname = part.split(":")[1] - tdbpath = os.path.join(privatedir, tdbname) - - db = ldb.Ldb(url=tdbpath, options=["modules:"]) + dbname = str(part).split(":")[1] + dbpath = os.path.join(privatedir, dbname) + db = ldb.Ldb(url="ldb://" + dbpath, + options=["modules:"], + flags=ldb.FLG_DONT_CREATE_DB) db.transaction_start() db.modify(modmsg) dbs.append(db) @@ -73,7 +76,8 @@ samdb.transaction_commit() print("Re-opening with the full DB stack") samdb = SamDB(url=url, - lp=lp_ctx) + flags=ldb.FLG_DONT_CREATE_DB, + lp=lp_ctx) print("Re-triggering another re-index") chk = dbcheck(samdb) |