From 0ab3086b46259a4627eabab93ebda41fd21408b0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Jul 2011 11:05:43 +1000 Subject: dbcheck: added --reindex option this allows you to force a reindex of the database Pair-Programmed-With: Amitay Isaacs Pair-Programmed-With: Andrew Bartlett --- source4/scripting/python/samba/dbchecker.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/scripting/python/samba/dbchecker.py') 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) -- cgit