Implement mypy in the most non-breaking way possible. There's still some
changes of behavior that crept in, merely due to incorrect edge case
handling.
Charm libraries are generally well typed, include py.typed marker for
all of the libraries, to allow mypy analyzing their usage.
Change-Id: I7bda1913fa08dd4954a606526272ac80b45197cc
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
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
Currently `get_all_unit_values` will return the values set by
remote units. The new `include_local_unit` option will add the
value that the local unit has set to the list.
Change-Id: I9c75535c7b71af7585bbb31dda86035f5216c08e
If a remote unit has not provided a value for a given key don't
append to the values list - this results in Python None being
added to the list which causes issues in consuming templates
and code.
Change-Id: If5985105714566cddf5bba9fe639097b1c44c1dc
Following changes are done as part of this patch
* Rename package name to ops_sunbeam
* Rename shared_code/aso_charm to shared_code/sunbeam_charm
* Modify rest of scripts as per above changes
* Code cleanup