There is an issue with the reactive framework trying to import all *.py
files from hooks/relations to inspect for reactive state handlers.
operator.py being in this interface-layer's master branch breaks
deployment of newly built reactive charms using this interface.
This help to avoid following errors while relation joined:
1)
our_unit_data["metrics_path"] = self.state.metrics_path
File "/var/lib/juju/agents/unit-cloudstats-1/charm/venv/ops/model.py", line 688, in __setitem__
raise RelationDataError('relation data values must be strings')
2)
File "/var/lib/juju/agents/unit-cloudstats-1/charm/lib/interface_prometheus/operator.py", line 122, in _update_scrape_targets
our_unit_data["labels"] = json.dumps(dict(self.state.labels))
TypeError: 'NoneType' object is not iterable
unit-cloudstats-1: 16:38:54 ERROR juju.worker.uniter.operation hook "prometheus-scrape-target-relation-joined" failed: exit status 1
This help to avoid following errors while relation joined:
1)
our_unit_data["metrics_path"] = self.state.metrics_path
File "/var/lib/juju/agents/unit-cloudstats-1/charm/venv/ops/model.py", line 688, in __setitem__
raise RelationDataError('relation data values must be strings')
2)
File "/var/lib/juju/agents/unit-cloudstats-1/charm/lib/interface_prometheus/operator.py", line 122, in _update_scrape_targets
our_unit_data["labels"] = json.dumps(dict(self.state.labels))
TypeError: 'NoneType' object is not iterable
unit-cloudstats-1: 16:38:54 ERROR juju.worker.uniter.operation hook "prometheus-scrape-target-relation-joined" failed: exit status 1