mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
py3: open temporary ldif file in text mode
ldif parser uses file in text mode, so we have to open it in text mode in py3 Also values passed to parser should be bytes https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
@@ -587,14 +587,15 @@ class DsInstance(service.Service):
|
||||
'dse.ldif'
|
||||
)
|
||||
|
||||
with tempfile.NamedTemporaryFile(delete=False) as new_dse_ldif:
|
||||
with tempfile.NamedTemporaryFile(
|
||||
mode='w', delete=False) as new_dse_ldif:
|
||||
temp_filename = new_dse_ldif.name
|
||||
with open(dse_filename, "r") as input_file:
|
||||
parser = installutils.ModifyLDIF(input_file, new_dse_ldif)
|
||||
parser.replace_value(
|
||||
'cn=config,cn=ldbm database,cn=plugins,cn=config',
|
||||
'nsslapd-db-locks',
|
||||
['50000']
|
||||
[b'50000']
|
||||
)
|
||||
if self.config_ldif:
|
||||
# parse modifications from ldif file supplied by the admin
|
||||
|
||||
Reference in New Issue
Block a user