1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-13 08:59:08 +03:00

s4:provision Don't make the 'slaptest' call produce errors

Adding -n 0 also allows us to check the error code too

Andrew Bartlett
This commit is contained in:
Andrew Bartlett
2010-04-05 19:03:14 +10:00
parent 0340826772
commit bc6659936a

View File

@ -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")