Samuel Allan 539f36817f
[tempest-k8s] Fix error on remove-application
Previously on application remove,
tempest-k8s charm would error at the relation-broken hook,
causing the removal to fail:

```
tempest/0*                   error        idle       10.1.169.40         hook failed: "identity-ops-relation-broken"
```

with traceback:

```
  File "/var/lib/juju/agents/unit-tempest-0/charm/src/handlers.py", line 609, in _on_provider_goneaway
    self.charm.set_tempest_ready(False)
  File "/var/lib/juju/agents/unit-tempest-0/charm/./src/charm.py", line 283, in set_tempest_ready
    self.peers.set_unit_data({TEMPEST_READY_KEY: "true" if ready else ""})
  File "/var/lib/juju/agents/unit-tempest-0/charm/lib/ops_sunbeam/relation_handlers.py", line 625, in set_unit_data
    self.interface.set_unit_data(settings)
  File "/var/lib/juju/agents/unit-tempest-0/charm/lib/ops_sunbeam/interfaces.py", line 150, in set_unit_data
    self.peers_rel.data[self.model.unit][k] = v
AttributeError: 'NoneType' object has no attribute 'data'
```

This fixes the issue for tempest (and potentially if similar issues
are present on other sunbeam charms),
by checking if peels_rel exists because trying to interact with it.

Change-Id: I5e01c1dba719a63160f0452282d57b9eae14b41b
2024-05-15 14:32:46 +02:00
..
2024-05-10 12:23:45 +02:00
2021-10-14 15:20:30 +01:00
2022-08-04 13:28:10 +05:30
2023-09-19 06:35:29 +00:00
2023-10-06 10:36:48 +02:00
2022-02-09 16:09:54 +00:00
2024-01-27 14:29:40 +01:00
2023-05-02 14:03:00 +05:30
2021-09-27 12:36:57 +01:00
2023-09-26 17:07:31 +02:00
2023-03-15 14:28:42 +00:00