krainstance: fix writing str to file

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

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Stanislav Laznicka authored and Pavel Vomacka committed 2017-07-27 16:51:09 +02:00
1 parent 75d26e1f01
commit 276bef101b
1 file changed
+1 -1
+1 -1
View File
@@ -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))
)