The temporary file used to store the ca_cert was set to delete itself on close. This meant that when it was accessed multiple times it would no longer be present.
Set to not delete on close and to remove file when the proxy is deleted.
from juju import model
m = model.Model()
await m.connect()
await m.create_offer("grafana:grafana-dashboard", "grafana-dashboards")
await m.disconnect()
The temporary file used to store the ca_cert was set to delete itself on close. This meant that when it was accessed multiple times it would no longer be present.
Set to not delete on close and to remove file when the proxy is deleted.
QA Steps
In python
Check all resource in /tmp have been cleaned up
Fixes #1040