summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/dbchecker.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-12 11:05:43 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-13 12:51:05 +0200
commit0ab3086b46259a4627eabab93ebda41fd21408b0 (patch)
tree9e5956b408f2789fca5ada408f6cceecaa1aee3c /source4/scripting/python/samba/dbchecker.py
parent6bc1957a54ba2e3c73b0cf580c94e8055d451b03 (diff)
downloadsamba-0ab3086b46259a4627eabab93ebda41fd21408b0.tar.gz
samba-0ab3086b46259a4627eabab93ebda41fd21408b0.tar.xz
samba-0ab3086b46259a4627eabab93ebda41fd21408b0.zip
dbcheck: added --reindex option
this allows you to force a reindex of the database Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com> Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting/python/samba/dbchecker.py')
-rw-r--r--source4/scripting/python/samba/dbchecker.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/dbchecker.py b/source4/scripting/python/samba/dbchecker.py
index f89e2df878..1f250662ea 100644
--- a/source4/scripting/python/samba/dbchecker.py
+++ b/source4/scripting/python/samba/dbchecker.py
@@ -477,3 +477,13 @@ class dbcheck(object):
self.fix_metadata(dn, att)
return error_count
+
+ ###############################################
+ # re-index the database
+ def reindex_database(self):
+ '''re-index the whole database'''
+ m = ldb.Message()
+ m.dn = ldb.Dn(self.samdb, "@ATTRIBUTES")
+ m['add'] = ldb.MessageElement('NONE', ldb.FLAG_MOD_ADD, 'force_reindex')
+ m['delete'] = ldb.MessageElement('NONE', ldb.FLAG_MOD_DELETE, 'force_reindex')
+ return self.do_modify(m, [], 're-indexed database', validate=False)