Getting many KeyError errors during spaces checks

Bug #1979382 reported by Vern Hart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juju Lint
Fix Released
Undecided
Gabriel Cocenza

Bug Description

Running juju-lint on an exported bundle I get more than a dozen of these:

Exception caught during space check; please check space by hand. Traceback (most recent call last):
  File "/snap/juju-lint/current/lib/python3.8/site-packages/jujulint/lint.py", line 696, in check_spaces
    self._handle_space_mismatch(
  File "/snap/juju-lint/current/lib/python3.8/site-packages/jujulint/lint.py", line 725, in _handle_space_mismatch
    mismatch_relation = mismatch.get_charm_relation(self.model.app_to_charm)
  File "/snap/juju-lint/current/lib/python3.8/site-packages/jujulint/check_spaces.py", line 63, in get_charm_relation
    charm2 = app_to_charm_map[app2]
KeyError: 'prometheus'

It looks like these are related to CMR relations since all the applications mentioned in the KeyError are applications in a different model.

Full run attached.

Tags: bseng-173

Related branches

Revision history for this message
Vern Hart (vern) wrote :
Revision history for this message
Vern Hart (vern) wrote :
Revision history for this message
Vern Hart (vern) wrote :

The attached patch uses the app_to_charm_map.get(app) method instead of app_to_charm_map[app] and ignores mismatches if one of the spaces is XModel (as set by the existing get_relation_space function).

Changed in juju-lint:
status: New → Confirmed
Eric Chen (eric-chen)
tags: added: bseng-173
Changed in juju-lint:
assignee: nobody → Gabriel Angelo Sgarbi Cocenza (gabrielcocenza)
status: Confirmed → In Progress
Changed in juju-lint:
status: In Progress → Fix Released
Changed in juju-lint:
milestone: none → 1.0.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.