]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/telegraf: define options using Option
authorKefu Chai <kchai@redhat.com>
Mon, 22 Mar 2021 09:45:34 +0000 (17:45 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Mar 2021 11:42:03 +0000 (19:42 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/telegraf/module.py

index d5041c88572bab229344bcd66f3a42cb07bd8517..afbc7309c21abea818541018d0e42f689698d441 100644 (file)
@@ -7,7 +7,7 @@ from threading import Event
 
 from telegraf.basesocket import BaseSocket
 from telegraf.protocol import Line
-from mgr_module import MgrModule, PG_STATES
+from mgr_module import MgrModule, Option, PG_STATES
 
 from urllib.parse import urlparse
 
@@ -33,16 +33,11 @@ class Module(MgrModule):
     ]
 
     MODULE_OPTIONS = [
-        {
-            'name': 'address',
-            'default': 'unixgram:///tmp/telegraf.sock',
-        },
-        {
-            'name': 'interval',
-            'type': 'secs',
-            'default': 15
-        }
-    ]
+        Option(name='address',
+               default='unixgram:///tmp/telegraf.sock'),
+        Option(name='interval',
+               type='secs',
+               default=15)]
 
     ceph_health_mapping = {'HEALTH_OK': 0, 'HEALTH_WARN': 1, 'HEALTH_ERR': 2}