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 2017-07-27 11:54:44 +02:00 committed by Pavel Vomacka
parent 75d26e1f01
commit 276bef101b

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))
)