]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/diskprediction_local: use "int" for interval options
authorKefu Chai <kchai@redhat.com>
Fri, 19 Feb 2021 15:52:42 +0000 (23:52 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 20 Feb 2021 06:36:53 +0000 (14:36 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/diskprediction_local/module.py

index b466c2e8d8618fc7e3af79586f8ec64c95fc6a5e..3a8113ad410dccbcafa0e67482ce4a78254f81bd 100644 (file)
@@ -25,9 +25,9 @@ TIME_WEEK = TIME_DAYS * 7
 class Module(MgrModule):
     MODULE_OPTIONS = [
         Option(name='sleep_interval',
-               default=str(600)),
+               default=600),
         Option(name='predict_interval',
-               default=str(86400)),
+               default=86400),
         Option(name='predictor_model',
                default='prophetstor')
     ]
@@ -89,7 +89,7 @@ class Module(MgrModule):
                 if not last_predicted:
                     next_predicted = now
                 else:
-                    predicted_frequency = int(self.predict_interval) or 86400
+                    predicted_frequency = self.predict_interval or 86400
                     seconds = (last_predicted - datetime.datetime.utcfromtimestamp(0)).total_seconds()
                     seconds -= seconds % predicted_frequency
                     seconds += predicted_frequency
@@ -106,7 +106,7 @@ class Module(MgrModule):
                     last_predicted = now
                     self.set_store('last_predicted', last_predicted.strftime(TIME_FORMAT))
 
-            sleep_interval = int(self.sleep_interval) or 60
+            sleep_interval = self.sleep_interval or 60
             self.log.debug('Sleeping for %d seconds', sleep_interval)
             self._event.wait(sleep_interval)
             self._event.clear()