The reason behind 2. seems as follows.
(Pdb) l 85 import pdb; pdb.set_trace() 86 if ca_cert: 87 cert_file = ('/usr/local/share/ca-certificates/' 88 'keystone_juju_ca_cert.crt') 89 old_cert = retrieve_ca_cert(cert_file) 90 -> if old_cert and old_cert == ca_cert: 91 log("CA cert is the same as installed version", level=INFO) 92 else: 93 log("Installing new CA cert", level=INFO) 94 with open(cert_file, 'wb') as crt: 95 crt.write(ca_cert) (Pdb) old_cert '-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n' (Pdb) ca_cert b'-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n'
^^^ certs are identical, but the diff if plain text vs binary.
The reason behind 2. seems as follows.
(Pdb) l local/share/ ca-certificates /' juju_ca_ cert.crt' ) ca_cert( cert_file) ----\n. ..\n--- --END CERTIFICATE-----\n' ----\n. ..\n--- --END CERTIFICATE-----\n'
85 import pdb; pdb.set_trace()
86 if ca_cert:
87 cert_file = ('/usr/
88 'keystone_
89 old_cert = retrieve_
90 -> if old_cert and old_cert == ca_cert:
91 log("CA cert is the same as installed version", level=INFO)
92 else:
93 log("Installing new CA cert", level=INFO)
94 with open(cert_file, 'wb') as crt:
95 crt.write(ca_cert)
(Pdb) old_cert
'-----BEGIN CERTIFICATE-
(Pdb) ca_cert
b'-----BEGIN CERTIFICATE-
^^^ certs are identical, but the diff if plain text vs binary.