1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-14 12:59:07 +03:00

Fix templates.ldb reprovision handling.

This sets the attributes in a seperate transaction, and allows a
forced delete of the whole file.

Andrew Bartlett
(This used to be commit 423db2468b)
This commit is contained in:
Andrew Bartlett
2008-08-19 11:43:41 +10:00
parent bb80a19714
commit 47d80366be
3 changed files with 21 additions and 11 deletions

View File

@ -617,7 +617,17 @@ def setup_templatesdb(path, setup_path, session_info, credentials, lp):
"""
templates_ldb = SamDB(path, session_info=session_info,
credentials=credentials, lp=lp)
templates_ldb.erase()
# Wipes the database
try:
templates_ldb.erase()
except:
os.unlink(path)
templates_ldb.load_ldif_file_add(setup_path("provision_templates_init.ldif"))
templates_ldb = SamDB(path, session_info=session_info,
credentials=credentials, lp=lp)
templates_ldb.load_ldif_file_add(setup_path("provision_templates.ldif"))