]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/zabbix: add desc to commands 39600/head
authorKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 02:47:30 +0000 (10:47 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 02:50:04 +0000 (10:50 +0800)
it was an oversight in 43802146b070e2d5dddc59b32fba549f14afa375 which
failed to migrate the desc as docstrings.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/zabbix/module.py

index 0dd34953072d6e4762c07cb7cc43e5f9f2e8e707..638b688562f2f417526d9fc44bb6aae339382d83 100644 (file)
@@ -87,30 +87,6 @@ class Module(MgrModule):
             default=100)
     ]
 
-    COMMANDS = [
-        {
-            "cmd": "zabbix config-set name=key,type=CephString "
-                   "name=value,type=CephString",
-            "desc": "Set a configuration value",
-            "perm": "rw"
-        },
-        {
-            "cmd": "zabbix config-show",
-            "desc": "Show current configuration",
-            "perm": "r"
-        },
-        {
-            "cmd": "zabbix send",
-            "desc": "Force sending data to Zabbix",
-            "perm": "rw"
-        },
-        {
-            "cmd": "zabbix discovery",
-            "desc": "Discovering Zabbix data",
-            "perm": "r"
-        },
-    ]
-
     def __init__(self, *args: Any, **kwargs: Any) -> None:
         super(Module, self).__init__(*args, **kwargs)
         self.event = Event()
@@ -405,10 +381,16 @@ class Module(MgrModule):
 
     @CLIReadCommand('zabbix config-show')
     def config_show(self) -> Tuple[int, str, str]:
+        """
+        Show current configuration
+        """
         return 0, json.dumps(self.config, indent=4, sort_keys=True), ''
 
     @CLIWriteCommand('zabbix config-set')
     def config_set(self, key: str, value: str) -> Tuple[int, str, str]:
+        """
+        Set a configuration value
+        """
         if not value:
             return -errno.EINVAL, '', 'Value should not be empty or None'
 
@@ -423,6 +405,9 @@ class Module(MgrModule):
 
     @CLIReadCommand('zabbix send')
     def do_send(self) -> Tuple[int, str, str]:
+        """
+        Force sending data to Zabbix
+        """
         data = self.get_data()
         if self.send(data):
             return 0, 'Sending data to Zabbix', ''
@@ -431,6 +416,9 @@ class Module(MgrModule):
 
     @CLIReadCommand('zabbix discovery')
     def do_discovery(self) -> Tuple[int, str, str]:
+        """
+        Discovering Zabbix data
+        """
         if self.discovery():
             return 0, 'Sending discovery data to Zabbix', ''