dbcheck: only do the provision dbcheck if there are objects to check
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2011 00:54:50 +0000 (10:54 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2011 10:51:05 +0000 (12:51 +0200)
when in FILL_DRS mode, there are no objects to check yet

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

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

index 66dcf6a40bf5bee1409be86c982d9243554d1b45..97cf7bff1797f5d3ae6cac7456f79b24f6f75962 100644 (file)
@@ -1837,19 +1837,20 @@ def provision(logger, session_info, credentials, smbconf=None,
                 logger.info("Failed to chown %s to bind gid %u",
                             dns_keytab_path, paths.bind_gid)
 
-    # fix any dangling GUIDs from the provision
-    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',
-                              'ipsecFilterReference',
-                              'ipsecISAKMPReference',
-                              'ipsecNegotiationPolicyReference',
-                              'ipsecNFAReference'])
-    samdb.transaction_commit()
+    if samdb_fill != FILL_DRS:
+        # fix any dangling GUIDs from the provision
+        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',
+                                  'ipsecFilterReference',
+                                  'ipsecISAKMPReference',
+                                  'ipsecNegotiationPolicyReference',
+                                  'ipsecNFAReference'])
+        samdb.transaction_commit()
 
 
     logger.info("Please install the phpLDAPadmin configuration located at %s into /etc/phpldapadmin/config.php",