1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

s4:provision Improved error handling in provisionbackend

When using OpenLDAP as a backend with Samba4 we get failure during
provision and this patch will help better determining the real error.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Zahari Zahariev 2010-07-03 21:43:42 +03:00 committed by Andrew Bartlett
parent 97246f7bbd
commit 9aae50443d

View File

@ -538,11 +538,12 @@ class OpenLDAPBackend(LDAPBackend):
if not os.path.isdir(self.olcdir):
os.makedirs(self.olcdir, 0770)
retcode = subprocess.call([self.slapd_path, "-Ttest", "-n", "0",
"-f", self.slapdconf, "-F", self.olcdir], close_fds=True,
slapd_cmd = [self.slapd_path, "-Ttest", "-n", "0", "-f", self.slapdconf, "-F", self.olcdir]
retcode = subprocess.call(slapd_cmd, close_fds=True,
shell=False)
if retcode != 0:
self.logger.error("conversion from slapd.conf to cn=config failed slapd started with: %s" % "\'" + "\' \'".join(slapd_cmd) + "\'")
raise ProvisioningError("conversion from slapd.conf to cn=config failed")
if not os.path.exists(os.path.join(self.olcdir, "cn=config.ldif")):