summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-04-05 19:03:14 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-04-10 21:41:00 +1000
commitbc6659936a4719a30d1f289bca7dbe639cb972cf (patch)
treead68f15d3085229793b1b19f2d3c9e633f3a45b8 /source4/scripting/python
parent03408267720cc1326be06fe1b6871b31ab18c097 (diff)
downloadsamba-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
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/provisionbackend.py9
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")