canonical / charm-microceph

Charm to deploy/manage microceph
Apache License 2.0
2 stars 9 forks source link

'Model' object has no attribute 'application' #104

Closed gboutry closed 3 months ago

gboutry commented 3 months ago

Seen on latest/edge. the code is using self.model.application, which does not exist. It should use self.model.app

unit-microceph-0: 13:42:47 ERROR unit.microceph/0.juju-log ceph:2: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-microceph-0/charm/./src/charm.py", line 657, in <module>
    main(MicroCephCharm)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/main.py", line 551, in main
    manager.run()
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/main.py", line 530, in run
    self._emit()
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/main.py", line 519, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/main.py", line 147, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-microceph-0/charm/src/relation_handlers.py", line 437, in _on_relation_changed
    self._handle_client_relation(event.relation, event.unit)
  File "/var/lib/juju/agents/unit-microceph-0/charm/src/relation_handlers.py", line 528, in _handle_client_relation
    self.on.process_request.emit(
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-microceph-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-microceph-0/charm/src/relation_handlers.py", line 633, in _on_process_request
    self.interface.set_broker_response(
  File "/var/lib/juju/agents/unit-microceph-0/charm/src/relation_handlers.py", line 565, in set_broker_response
    relation.data[self.model.application][mon_key] = str(mon_addrs)
AttributeError: 'Model' object has no attribute 'application'