summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-31 18:36:24 +0100
committerJan Cholasta <jcholast@redhat.com>2017-02-10 14:03:04 +0100
commitf31d73b79aaa1746f7d32576658fcd4136870115 (patch)
tree2f8e3c934d4e3d99755483d21e647f7ba06182e6 /ipaserver/install
parentd4aa75d10582443b38447985c3fce8e65fcd48a6 (diff)
downloadfreeipa-f31d73b79aaa1746f7d32576658fcd4136870115.tar.gz
freeipa-f31d73b79aaa1746f7d32576658fcd4136870115.tar.xz
freeipa-f31d73b79aaa1746f7d32576658fcd4136870115.zip
py3: upgradeinstance: open dse.ldif in textual mode
ldap ldif parser requires to have input file opened in textual mode https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/upgradeinstance.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipaserver/install/upgradeinstance.py b/ipaserver/install/upgradeinstance.py
index 8e2843686..b24489843 100644
--- a/ipaserver/install/upgradeinstance.py
+++ b/ipaserver/install/upgradeinstance.py
@@ -124,7 +124,7 @@ class IPAUpgrade(service.Service):
def __save_config(self):
shutil.copy2(self.filename, self.savefilename)
- with open(self.filename, "rb") as in_file:
+ with open(self.filename, "r") as in_file:
parser = GetEntryFromLDIF(in_file, entries_dn=["cn=config"])
parser.parse()
try:
@@ -156,8 +156,8 @@ class IPAUpgrade(service.Service):
def __enable_ds_global_write_lock(self):
ldif_outfile = "%s.modified.out" % self.filename
- with open(ldif_outfile, "wb") as out_file:
- with open(self.filename, "rb") as in_file:
+ with open(ldif_outfile, "w") as out_file:
+ with open(self.filename, "r") as in_file:
parser = installutils.ModifyLDIF(in_file, out_file)
parser.replace_value(
@@ -172,8 +172,8 @@ class IPAUpgrade(service.Service):
global_lock = self.restore_state('nsslapd-global-backend-lock')
ldif_outfile = "%s.modified.out" % self.filename
- with open(ldif_outfile, "wb") as out_file:
- with open(self.filename, "rb") as in_file:
+ with open(ldif_outfile, "w") as out_file:
+ with open(self.filename, "r") as in_file:
parser = installutils.ModifyLDIF(in_file, out_file)
if port is not None:
@@ -194,8 +194,8 @@ class IPAUpgrade(service.Service):
def __disable_listeners(self):
ldif_outfile = "%s.modified.out" % self.filename
- with open(ldif_outfile, "wb") as out_file:
- with open(self.filename, "rb") as in_file:
+ with open(ldif_outfile, "w") as out_file:
+ with open(self.filename, "r") as in_file:
parser = installutils.ModifyLDIF(in_file, out_file)
parser.replace_value("cn=config", "nsslapd-port", ["0"])
parser.replace_value("cn=config", "nsslapd-security", ["off"])