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'
(cherry picked from commit 347b5d1e50
)
This commit is contained in:
parent
02e591746c
commit
0f8b06a8f6
1 changed files with 1 additions and 1 deletions
|
@ -689,7 +689,7 @@ class AcmeCertificate(Certificate):
|
|||
'--acme-dir', self.challenge_path], stdout=subprocess.PIPE)
|
||||
crt = p.communicate()[0]
|
||||
with open(self.path, 'wb') as certfile:
|
||||
certfile.write(str(crt))
|
||||
certfile.write(to_bytes(crt))
|
||||
except OSError as exc:
|
||||
raise CertificateError(exc)
|
||||
|
||||
|
|
Loading…
Reference in a new issue