diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-04-05 19:03:14 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-04-10 21:41:00 +1000 |
commit | bc6659936a4719a30d1f289bca7dbe639cb972cf (patch) | |
tree | ad68f15d3085229793b1b19f2d3c9e633f3a45b8 | |
parent | 03408267720cc1326be06fe1b6871b31ab18c097 (diff) | |
download | samba-bc6659936a4719a30d1f289bca7dbe639cb972cf.tar.gz samba-bc6659936a4719a30d1f289bca7dbe639cb972cf.tar.bz2 samba-bc6659936a4719a30d1f289bca7dbe639cb972cf.zip |
s4:provision Don't make the 'slaptest' call produce errors
Adding -n 0 also allows us to check the error code too
Andrew Bartlett
-rw-r--r-- | source4/scripting/python/samba/provisionbackend.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py index e5d4d8e1b1..08deb4a163 100644 --- a/source4/scripting/python/samba/provisionbackend.py +++ b/source4/scripting/python/samba/provisionbackend.py @@ -506,13 +506,10 @@ class OpenLDAPBackend(LDAPBackend): if not os.path.isdir(self.olcdir): os.makedirs(self.olcdir, 0770) - retcode = subprocess.call([self.slapd_path, "-Ttest", "-f", self.slapdconf, "-F", self.olcdir], close_fds=True, shell=False) + retcode = subprocess.call([self.slapd_path, "-Ttest", "-n", "0", "-f", self.slapdconf, "-F", self.olcdir], close_fds=True, shell=False) -# We can't do this, as OpenLDAP is strange. It gives an error -# output to the above, but does the conversion sucessfully... -# -# if retcode != 0: -# raise ProvisioningError("conversion from slapd.conf to cn=config failed") + if retcode != 0: + raise ProvisioningError("conversion from slapd.conf to cn=config failed") if not os.path.exists(os.path.join(self.olcdir, "cn=config.ldif")): raise ProvisioningError("conversion from slapd.conf to cn=config failed") |