Skip to content

Commit 53e6b00

Browse files
Fix bug in lifecycle.py for subordinate charms without other relations (#78)
_UnitTearingDownAndAppActive was set to UNKNOWN for subordinate charms without non-subordinate relations during relation-broken
1 parent ebe97d9 commit 53e6b00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lifecycle.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def _on_subordinate_relation_broken(self, event: ops.RelationBrokenEvent) -> Non
123123
if "dying" in principal_unit_statuses and principal_unit_statuses != {"dying"}:
124124
# Situation #4
125125
self._unit_tearing_down_and_app_active = _UnitTearingDownAndAppActive.TRUE
126+
else:
127+
# Situation #1, #2, or #3
128+
self._unit_tearing_down_and_app_active = _UnitTearingDownAndAppActive.FALSE
126129

127130
@property
128131
def authorized_leader(self) -> bool:

0 commit comments

Comments
 (0)