]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/diskprediction_local: define options using Option
authorKefu Chai <kchai@redhat.com>
Fri, 19 Feb 2021 15:50:51 +0000 (23:50 +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 7c2bdbcef38ab1508b3382259e8ba48978207029..b466c2e8d8618fc7e3af79586f8ec64c95fc6a5e 100644 (file)
@@ -6,7 +6,7 @@ import datetime
 from threading import Event
 import time
 
-from mgr_module import MgrModule, CommandResult
+from mgr_module import CommandResult, MgrModule, Option
 
 # Importing scipy early appears to avoid a future deadlock when
 # we try to do
@@ -24,18 +24,12 @@ TIME_WEEK = TIME_DAYS * 7
 
 class Module(MgrModule):
     MODULE_OPTIONS = [
-        {
-            'name': 'sleep_interval',
-            'default': str(600),
-        },
-        {
-            'name': 'predict_interval',
-            'default': str(86400),
-        },
-        {
-            'name': 'predictor_model',
-            'default': 'prophetstor',
-        },
+        Option(name='sleep_interval',
+               default=str(600)),
+        Option(name='predict_interval',
+               default=str(86400)),
+        Option(name='predictor_model',
+               default='prophetstor')
     ]
 
     COMMANDS = []