misc: do not leak file descriptors

This commit is contained in:
Benjamin Dauvergne 2020-04-25 08:55:15 +02:00
parent 248924132c
commit bc6424cbbd
1 changed files with 6 additions and 3 deletions

View File

@ -93,9 +93,12 @@ olcAccess: {{0}}to *
process = None
schemas = ['core', 'cosine', 'inetorgperson', 'nis', 'eduorg-200210-openldap', 'eduperson',
'supann-2009']
schemas_ldif = [codecs.open(os.path.join(os.path.dirname(__file__),
'schemas', '%s.ldif' % schema),
encoding='utf-8').read() for schema in schemas]
schemas_ldif = []
for schema in schemas:
with codecs.open(
os.path.join(
os.path.dirname(__file__), 'schemas', '%s.ldif' % schema), encoding='utf-8') as fd:
schemas_ldif.append(fd.read())
checkpoints = None
data_dirs = None
db_index = 1