From 6f3fcde9eae34e45968ee88e6b6020189996e0db Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 19 Feb 2021 23:50:51 +0800 Subject: [PATCH] mgr/diskprediction_local: define options using Option Signed-off-by: Kefu Chai --- src/pybind/mgr/diskprediction_local/module.py | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/pybind/mgr/diskprediction_local/module.py b/src/pybind/mgr/diskprediction_local/module.py index 7c2bdbcef38..b466c2e8d86 100644 --- a/src/pybind/mgr/diskprediction_local/module.py +++ b/src/pybind/mgr/diskprediction_local/module.py @@ -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 = [] -- 2.39.5