From 9aae50443df5471b91e4d829c0ca0285adeb71bb Mon Sep 17 00:00:00 2001 From: Zahari Zahariev Date: Sat, 3 Jul 2010 21:43:42 +0300 Subject: 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 --- source4/scripting/python/samba/provisionbackend.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/provisionbackend.py b/source4/scripting/python/samba/provisionbackend.py index ccb793f3e5..07d3bf7442 100644 --- a/source4/scripting/python/samba/provisionbackend.py +++ b/source4/scripting/python/samba/provisionbackend.py @@ -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")): -- cgit