]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add enhanced scan option to agent's volume gatherer
authorAdam King <adking@redhat.com>
Thu, 9 Dec 2021 20:23:09 +0000 (15:23 -0500)
committerAdam King <adking@redhat.com>
Thu, 16 Dec 2021 12:33:50 +0000 (07:33 -0500)
Signed-off-by: Adam King <adking@redhat.com>
src/cephadm/cephadm

index 5e2d958d667483c7886a2034b3a6651a3026ae47..a3f9ee89819cef6a504d8c2eace3eb7ca20a115a 100755 (executable)
@@ -3589,8 +3589,8 @@ class CephadmAgent():
         self.ack = 1
         self.event = Event()
         self.mgr_listener = MgrListener(self)
-        self.ls_gatherer = AgentGatherer(self, self._get_ls, 'Ls')
-        self.volume_gatherer = AgentGatherer(self, self._ceph_volume, 'Volume')
+        self.ls_gatherer = AgentGatherer(self, lambda: self._get_ls(), 'Ls')
+        self.volume_gatherer = AgentGatherer(self, lambda: self._ceph_volume(enhanced=False), 'Volume')
         self.device_enhanced_scan = False
         self.recent_iteration_run_times: List[float] = [0.0, 0.0, 0.0]
         self.recent_iteration_index: int = 0
@@ -3692,6 +3692,7 @@ WantedBy=ceph-{fsid}.target
         self.device_enhanced_scan = False
         if use_lsm.lower() == 'true':
             self.device_enhanced_scan = True
+        self.volume_gatherer.update_func(lambda: self._ceph_volume(enhanced=self.device_enhanced_scan))
 
     def run(self) -> None:
         self.pull_conf_settings()
@@ -3956,6 +3957,9 @@ class AgentGatherer(Thread):
     def wakeup(self) -> None:
         self.event.set()
 
+    def update_func(self, func: Callable) -> None:
+        self.func = func
+
 
 def command_agent(ctx: CephadmContext) -> None:
     agent = CephadmAgent(ctx, ctx.fsid, ctx.daemon_id)