write need bytes object on python 3 (#35143)
Otherwise, it fail with: Traceback (most recent call last): File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 808, in <module> main() File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 787, in main certificate.generate(module) File \"/tmp/ansible_c1zmq3i9/ansible_module_openssl_certificate.py\", line 692, in generate certfile.write(str(crt)) TypeError: a bytes-like object is required, not 'str'
This commit is contained in:
parent
f23f277e46
commit
347b5d1e50
1 changed files with 1 additions and 1 deletions
|
@ -757,7 +757,7 @@ class AcmeCertificate(Certificate):
|
||||||
self.challenge_path),
|
self.challenge_path),
|
||||||
check_rc=True)[1]
|
check_rc=True)[1]
|
||||||
with open(self.path, 'wb') as certfile:
|
with open(self.path, 'wb') as certfile:
|
||||||
certfile.write(str(crt))
|
certfile.write(to_bytes(crt))
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
raise CertificateError(exc)
|
raise CertificateError(exc)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue