mirror of
https://github.com/samba-team/samba.git
synced 2025-07-12 04:59:09 +03:00
s4:provision Remove LDB backend files in provision
Rather than try and remove the records in the LDB files, make the provision remove the whole file. This also removes the need to try and carry forward the old ldb filenames. Andrew Bartlett
This commit is contained in:
@ -30,6 +30,7 @@ import os
|
||||
import sys
|
||||
import uuid
|
||||
import time
|
||||
import shutil
|
||||
|
||||
from samba import read_and_sub_file
|
||||
from samba import Ldb
|
||||
@ -80,6 +81,9 @@ class ProvisionBackend(object):
|
||||
if self.type is "ldb":
|
||||
self.credentials = None
|
||||
self.secrets_credentials = None
|
||||
|
||||
# Wipe the old sam.ldb databases away
|
||||
shutil.rmtree(paths.samdb + ".d", True)
|
||||
return
|
||||
|
||||
self.ldapi_uri = "ldapi://" + urllib.quote(os.path.join(paths.ldapdir, "ldapi"), safe="")
|
||||
@ -230,6 +234,9 @@ def provision_openldap_backend(result, setup_path=None, names=None,
|
||||
slapd_path=None, nosync=False,
|
||||
ldap_dryrun_mode=False):
|
||||
|
||||
# Wipe the directories so we can start
|
||||
shutil.rmtree(os.path.join(result.paths.ldapdir, "db"), True)
|
||||
|
||||
#Allow the test scripts to turn off fsync() for OpenLDAP as for TDB and LDB
|
||||
nosync_config = ""
|
||||
if nosync:
|
||||
|
Reference in New Issue
Block a user