diff options
author | Zahari Zahariev <zahari.zahariev@postpath.com> | 2010-07-03 21:43:42 +0300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-09-02 10:40:34 +1000 |
commit | 9aae50443df5471b91e4d829c0ca0285adeb71bb (patch) | |
tree | 6ac8e84aeb995dd6f98e2cafdb3434fd041c1718 /source4/scripting | |
parent | 97246f7bbd4f1df1002b606051bfb2dde4977e4a (diff) | |
download | samba-9aae50443df5471b91e4d829c0ca0285adeb71bb.tar.gz samba-9aae50443df5471b91e4d829c0ca0285adeb71bb.tar.bz2 samba-9aae50443df5471b91e4d829c0ca0285adeb71bb.zip |
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>
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/provisionbackend.py | 5 |
1 files changed, 3 insertions, 2 deletions
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")): |