Skip to content

Commit

Permalink
Fix bug in lifecycle.py for subordinate charms without other relations
Browse files Browse the repository at this point in the history
_UnitTearingDownAndAppActive was set to UNKNOWN for subordinate charms without non-subordinate relations during relation-broken
  • Loading branch information
carlcsaposs-canonical committed Oct 6, 2023
1 parent ebe97d9 commit ab59136
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def _on_subordinate_relation_broken(self, event: ops.RelationBrokenEvent) -> Non
if "dying" in principal_unit_statuses and principal_unit_statuses != {"dying"}:
# Situation #4
self._unit_tearing_down_and_app_active = _UnitTearingDownAndAppActive.TRUE
else:
# Situation #1, #2, or #3
self._unit_tearing_down_and_app_active = _UnitTearingDownAndAppActive.FALSE

@property
def authorized_leader(self) -> bool:
Expand Down

0 comments on commit ab59136

Please sign in to comment.