From: Adam King Date: Thu, 9 Dec 2021 20:23:09 +0000 (-0500) Subject: cephadm: add enhanced scan option to agent's volume gatherer X-Git-Tag: v17.1.0~137^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=89fe5f2a0d270a1deed00a4a604828bed0b15c95;p=ceph-ci.git cephadm: add enhanced scan option to agent's volume gatherer Signed-off-by: Adam King --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 5e2d958d667..a3f9ee89819 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -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)