s4-provision: run dbcheck on a minimal set of objects in provision
authorAndrew Tridgell <tridge@samba.org>
Thu, 14 Jul 2011 03:35:14 +0000 (13:35 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 21 Jul 2011 01:44:36 +0000 (11:44 +1000)
this speeds up the dbcheck in provision to fix only the objects that
we know will need fixing

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/scripting/python/samba/provision/__init__.py

index 4fa282321483ca079e0aeb87138c19b6d0f2ee84..5b8dc703291781571b0f30e1c8523b99aa2bd886 100644 (file)
@@ -1845,10 +1845,14 @@ def provision(logger, session_info, credentials, smbconf=None,
         logger.info("Fixing provision GUIDs")
         chk = dbcheck(samdb, samdb_schema=samdb,  verbose=False, fix=True, yes=True, quiet=True)
         samdb.transaction_start()
-        chk.check_database(DN=None, controls=["search_options:1:2", "show_deleted:1"],
-                           attrs=['defaultObjectCategory',
-                                  'objectCategory',
-                                  'ipsecOwnersReference',
+        # a small number of GUIDs are missing because of ordering issues in the
+        # provision code
+        for schema_obj in ['CN=Domain', 'CN=Organizational-Person', 'CN=Contact', 'CN=inetOrgPerson']:
+            chk.check_database(DN="%s,%s" % (schema_obj, names.schemadn),
+                               scope=ldb.SCOPE_BASE, attrs=['defaultObjectCategory'])
+        chk.check_database(DN="CN=IP Security,CN=System,%s" % names.domaindn,
+                           scope=ldb.SCOPE_ONELEVEL,
+                           attrs=['ipsecOwnersReference',
                                   'ipsecFilterReference',
                                   'ipsecISAKMPReference',
                                   'ipsecNegotiationPolicyReference',