From 276bef101b9fa0f83e5de353bc733270d958ee41 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Jul 27 2017 14:51:09 +0000 Subject: krainstance: fix writing str to file https://pagure.io/freeipa/issue/4985 Reviewed-By: Stanislav Laznicka --- diff --git a/ipaserver/install/krainstance.py b/ipaserver/install/krainstance.py index 7f82b75..79ad853 100644 --- a/ipaserver/install/krainstance.py +++ b/ipaserver/install/krainstance.py @@ -274,7 +274,7 @@ class KRAInstance(DogtagInstance): parentdir = os.path.dirname(paths.ADMIN_CERT_PATH) if not os.path.exists(parentdir): os.makedirs(parentdir) - with open(paths.ADMIN_CERT_PATH, "w") as admin_path: + with open(paths.ADMIN_CERT_PATH, "wb") as admin_path: admin_path.write( base64.b64encode(cert.public_bytes(x509.Encoding.DER)) )