From 371afc47dc744ce4012f5ea00ced29653bd5869a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 30 Oct 2009 23:42:03 +1100 Subject: 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 --- source4/scripting/python/samba/provisionbackend.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/scripting/python/samba/provisionbackend.py') diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py index fc1bac673d9..8f1b94f1bd5 100644 --- a/source4/scripting/python/samba/provisionbackend.py +++ b/source4/scripting/python/samba/provisionbackend.py @@ -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: -- cgit