diff --git a/src/charm.py b/src/charm.py index 4faae22..184eabd 100755 --- a/src/charm.py +++ b/src/charm.py @@ -447,7 +447,11 @@ def _on_nrpe_targets_changed(self, event): a["labels"]["juju_unit"], # type: ignore ) - nrpes = cast(List[Dict[str, Any]], event.current_targets) + nrpes = cast(List[Dict[str, Any]], event.current_targets) + else: + # If the event arg is None, then the stored state value is already up to date. + nrpes = self.nrpe_exporter.endpoints() + self._modify_enrichment_file(endpoints=nrpes) for nrpe in nrpes: