paper over failure to reprovision with os.unlink()
authorAndrew Bartlett <abartlet@samba.org>
Wed, 18 Feb 2009 06:44:07 +0000 (17:44 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 18 Feb 2009 06:44:07 +0000 (17:44 +1100)
We need to figure out why the deletes on the database fail, but for
now doing an unlink of templates_tdb isn't too bad.

Andrew Bartlett

source4/scripting/python/samba/provision.py

index 10daf1b2b92537d314f38138187aa1d9f195c41f..a5b3e8322faec34404bd83ca2a06d0ddb8313f43 100644 (file)
@@ -647,7 +647,8 @@ def setup_templatesdb(path, setup_path, session_info, credentials, lp):
     # Wipes the database
     try:
         templates_ldb.erase()
-    except LdbError:
+    # This should be 'except LdbError', but on a re-provision the assert in ldb.erase fires, and we need to catch that too
+    except:
         os.unlink(path)
 
     templates_ldb.load_ldif_file_add(setup_path("provision_templates_init.ldif"))