Skip to content

Commit adc40d0

Browse files
jdufresneencukou
authored andcommitted
In SlapdObject, build include directives dynamically
Allows overriding openldap_schema_files without requiring rewriting the conf file. python-ldap#196
1 parent 06be5eb commit adc40d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Lib/slapdtest/_slapdtest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
SLAPD_CONF_TEMPLATE = r"""
3030
serverID %(serverid)s
3131
moduleload back_%(database)s
32-
include "%(schema_prefix)s/core.schema"
32+
%(include_directives)s
3333
loglevel %(loglevel)s
3434
allow bind_v2
3535
@@ -316,9 +316,17 @@ def gen_config(self):
316316
for generating specific static configuration files you have to
317317
override this method
318318
"""
319+
include_directives = '\n'.join(
320+
'include "{schema_prefix}/{schema_file}"'.format(
321+
schema_prefix=self._schema_prefix,
322+
schema_file=schema_file,
323+
)
324+
for schema_file in self.openldap_schema_files
325+
)
319326
config_dict = {
320327
'serverid': hex(self.server_id),
321328
'schema_prefix':self._schema_prefix,
329+
'include_directives': include_directives,
322330
'loglevel': self.slapd_loglevel,
323331
'database': self.database,
324332
'directory': self._db_directory,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy