diff options
author | Martin Basti <mbasti@redhat.com> | 2017-01-09 12:42:23 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2017-01-24 13:25:47 +0100 |
commit | 63b5d4a8594c5c6bc9ade69996fbbc1bcf19a2bf (patch) | |
tree | 7d6bc8873c1c5e8c12336fae9e06ff72fa3c4eb8 /ipaserver | |
parent | e0641092770530e3b93c00de415172751d031210 (diff) | |
download | freeipa-63b5d4a8594c5c6bc9ade69996fbbc1bcf19a2bf.tar.gz freeipa-63b5d4a8594c5c6bc9ade69996fbbc1bcf19a2bf.tar.xz freeipa-63b5d4a8594c5c6bc9ade69996fbbc1bcf19a2bf.zip |
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>
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/dsinstance.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ipaserver/install/dsinstance.py b/ipaserver/install/dsinstance.py index 5a2802617..ceb7bf3fe 100644 --- a/ipaserver/install/dsinstance.py +++ b/ipaserver/install/dsinstance.py @@ -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 |