From bc6659936a4719a30d1f289bca7dbe639cb972cf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Apr 2010 19:03:14 +1000 Subject: s4:provision Don't make the 'slaptest' call produce errors Adding -n 0 also allows us to check the error code too Andrew Bartlett --- source4/scripting/python/samba/provisionbackend.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source4/scripting/python') 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") -- cgit