]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: do not restore channels default when opting-out
authorYaarit Hatuka <yaarit@redhat.com>
Wed, 12 Jan 2022 05:32:01 +0000 (05:32 +0000)
committerYaarit Hatuka <yaarit@redhat.com>
Thu, 13 Jan 2022 21:54:07 +0000 (21:54 +0000)
Other modules do not reset their configuration; keep telemetry module
consistent with this behavior.

Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
src/pybind/mgr/telemetry/module.py

index c30a488fee4dc8ba46d9b00fbe2bee7bb9268620..446a1bf1be33a6135ea54b75d532604e85759c6d 100644 (file)
@@ -1347,15 +1347,6 @@ class Module(MgrModule):
 
         return 0, msg, ''
 
-    def restore_default_opt_setting(self, opt_name: str) -> None:
-        for o in self.MODULE_OPTIONS:
-            if o['name'] == opt_name:
-                default_val = o.get('default', None)
-                self.set_module_option(opt_name, default_val)
-                setattr(self,
-                        opt_name,
-                        default_val)
-
     @CLIReadCommand('telemetry status')
     def status(self) -> Tuple[int, str, str]:
         '''
@@ -1444,10 +1435,7 @@ To enable, add '--license {LICENSE}' to the 'ceph telemetry on' command.'''
         self.set_store('last_opted_out_ceph_version', str(mon_min))
         self.last_opted_out_ceph_version = mon_min
 
-        for c in ALL_CHANNELS:
-            self.restore_default_opt_setting(f"channel_{c}")
-
-        msg = 'Telemetry is now disabled. Channels settings are restored to default.'
+        msg = 'Telemetry is now disabled.'
         return 0, msg, ''
 
     @CLIReadCommand('telemetry enable channel')