From 77ad2cd8e1874c3f27c9bee612fdfa3c0d4222ce Mon Sep 17 00:00:00 2001 From: Dragomir Penev <6687393+dragomirp@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:53:57 +0300 Subject: [PATCH] Don't fail if the unit is already missing (#243) --- src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 60c4ecdd9d..33cb83499d 100755 --- a/src/charm.py +++ b/src/charm.py @@ -566,7 +566,7 @@ def _reconfigure_cluster(self, event: HookEvent): """ if ( hasattr(event, "unit") - and event.unit is not None + and event.relation.data.get(event.unit) is not None and event.relation.data[event.unit].get("ip-to-remove") is not None ): ip_to_remove = event.relation.data[event.unit].get("ip-to-remove")