diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-08-19 11:43:41 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-08-19 11:43:41 +1000 |
commit | 47d80366bef5e62b6727a574b2300cc94a2e18f7 (patch) | |
tree | 230c0c76f43e020d6232352ae6f1ba9ad0706880 /source4/scripting | |
parent | bb80a19714048def04b9d94d4e9f125a20a95822 (diff) | |
download | samba-47d80366bef5e62b6727a574b2300cc94a2e18f7.tar.gz samba-47d80366bef5e62b6727a574b2300cc94a2e18f7.tar.bz2 samba-47d80366bef5e62b6727a574b2300cc94a2e18f7.zip |
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 423db2468ba3dac89cebc59c8498c0b08c5f3d7b)
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 4f7fbfc6e6..836509a620 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -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")) |