juju / charm-helpers

Apache License 2.0
18 stars 127 forks source link

[stable/xena] Ensure get_requests_for_local_unit doesn't fail on incomplete relation (#824) #828

Closed ajkavanagh closed 1 year ago

ajkavanagh commented 1 year ago

If the certificates relation has been set from a consuming charm for certificates, but the provider hasn't supplied a certificate, and the request is in the 'legacy' form, then the get_request_for_local_unit() function in cert_utils fails on accessing the (non-existant) 'ca' parameter in the databag. This patch ensures that if the 'ca' key is missing that the processing moves on to the next relation.

(cherry-picked from: c8f47207c1f1652ab2cbecaaad8a83b66f004e5e) Closes LP#2028683

jadonn commented 1 year ago

This change looks good to me. Will need someone else to sign off, of course