]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/insights/module.py
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / insights / module.py
index 21da24e11fb0bea6e161d2194d0172c7921d2b7d..a7a12fb7b258b756afc828134e0a3d912962f18e 100644 (file)
@@ -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):
         """
@@ -307,7 +309,10 @@ class Module(MgrModule):
         the selftest module to manage testing scenarios related to tracking
         health history.
         """
-        hours = long(hours)
+        try:
+            hours = long(hours)
+        except NameError:
+            hours = int(hours)
         health_util.NOW_OFFSET = datetime.timedelta(hours = hours)
         self.log.warning("Setting now time offset {}".format(health_util.NOW_OFFSET))