URL: https://github.com/freeipa/freeipa/pull/941
Author: stlaz
 Title: #941: Enable replica installation on DL0
Action: opened

PR body:
"""
This patchset fixes the `ipa-replica-prepare` script and thus
enables running `ipa-replica-install` in DL0 successfully.
It then makes `ipa-replica-prepare` to be run in DL0 by
default.

https://pagure.io/freeipa/issue/4985
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/941/head:pr941
git checkout pr941
From a6d9853724137c17215f21c6e932601554107566 Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 28 Jul 2017 14:26:24 +0200
Subject: [PATCH 1/2] certs: write and read bytes as such

There were several cases in ipaserver.install.certs where bytes
would be read/written as normal strings, this commit fixes that.

https://pagure.io/freeipa/issue/4985
---
 ipaserver/install/certs.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ipaserver/install/certs.py b/ipaserver/install/certs.py
index 210e7d2083..1b9085edbb 100644
--- a/ipaserver/install/certs.py
+++ b/ipaserver/install/certs.py
@@ -380,7 +380,7 @@ def create_server_cert(self, nickname, hostname, subject=None):
             self.issue_server_cert(self.certreq_fname, self.certder_fname)
             self.import_cert(self.certder_fname, nickname)
 
-            with open(self.certder_fname, "r") as f:
+            with open(self.certder_fname, "rb") as f:
                 dercert = f.read()
                 return x509.load_der_x509_certificate(dercert)
         finally:
@@ -459,7 +459,7 @@ def issue_server_cert(self, certreq_fname, cert_fname):
 
         # Write the certificate to a file. It will be imported in a later
         # step. This file will be read later to be imported.
-        with open(cert_fname, "w") as f:
+        with open(cert_fname, "wb") as f:
             f.write(cert)
 
     def issue_signing_cert(self, certreq_fname, cert_fname):
@@ -503,7 +503,7 @@ def issue_signing_cert(self, certreq_fname, cert_fname):
 
         # Write the certificate to a file. It will be imported in a later
         # step. This file will be read later to be imported.
-        with open(cert_fname, "w") as f:
+        with open(cert_fname, "wb") as f:
             f.write(cert)
 
     def add_cert(self, cert, nick, flags):

From 545141af709622f2293ee0e7a7a67ff166272d3e Mon Sep 17 00:00:00 2001
From: Stanislav Laznicka <slazn...@redhat.com>
Date: Fri, 28 Jul 2017 14:28:17 +0200
Subject: [PATCH 2/2] replica-prepare: run the script in py3 by default

https://pagure.io/freeipa/issue/4985
---
 freeipa.spec.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 44a290a294..8986e5996b 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -875,6 +875,7 @@ install/tools/ipa-compat-manage
 install/tools/ipa-dns-install
 install/tools/ipa-managed-entries
 install/tools/ipa-nis-manage
+install/tools/ipa-replica-prepare
 install/tools/ipactl
 '
 for P in $PY3_SUBST_PATHS; do
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to