From: Sage Weil Date: Thu, 30 Jan 2020 17:40:48 +0000 (-0600) Subject: mgr/insights: make 'insights prune-health-history 0' zap current state X-Git-Tag: v15.1.1~580^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=04f25b26c5aea5b4cf5cb94e939d6fba74228b27;p=ceph-ci.git mgr/insights: make 'insights prune-health-history 0' zap current state The self._health_slot value needs to be updated too if the current key is removed. Fixes: https://tracker.ceph.com/issues/43886 Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index 616fc649d69..a7a12fb7b25 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -130,6 +130,8 @@ class Module(MgrModule): for key in self._health_filter(lambda ts: ts <= cutoff): self.log.info("Removing old health slot key {}".format(key)) self.set_store(key, None) + if not hours: + self._health_slot = health_util.HealthHistorySlot() def _health_report(self, hours): """