diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-10-30 23:42:03 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-02 16:36:56 +1100 |
commit | 371afc47dc744ce4012f5ea00ced29653bd5869a (patch) | |
tree | 3b39146eaf9f7bd8856c05faeb78c77d529707ec /source4/scripting/python/samba/provisionbackend.py | |
parent | 6439bdeb3a50aaeb1a9c431b9036c44810d9a5e3 (diff) | |
download | samba-371afc47dc744ce4012f5ea00ced29653bd5869a.tar.gz samba-371afc47dc744ce4012f5ea00ced29653bd5869a.tar.xz samba-371afc47dc744ce4012f5ea00ced29653bd5869a.zip |
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
Diffstat (limited to 'source4/scripting/python/samba/provisionbackend.py')
-rw-r--r-- | source4/scripting/python/samba/provisionbackend.py | 7 |
1 files changed, 7 insertions, 0 deletions
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: |