From: Paul Cuzner Date: Wed, 20 Dec 2023 23:47:51 +0000 (-0500) Subject: orchestrator: Fix representation of threads in host ls X-Git-Tag: v18.2.4~190^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f1bf96fddc979e11329f555c43555a44e85d2cc;p=ceph.git orchestrator: Fix representation of threads in host ls This patch fixes the calculation when determining the number of threads for hosts when using the --detail parameter. Signed-off-by: Paul Cuzner (cherry picked from commit 5bc735fb6ffbdcacffc3e678b7682f91fe7593c2) --- diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 054cd58f8b0d..e0a89ecadcff 100644 --- a/src/pybind/mgr/orchestrator/module.py +++ b/src/pybind/mgr/orchestrator/module.py @@ -95,8 +95,9 @@ class HostDetails: if self._facts: self.server = f"{self._facts.get('vendor', '').strip()} {self._facts.get('model', '').strip()}" - _cores = self._facts.get('cpu_cores', 0) * self._facts.get('cpu_count', 0) - _threads = self._facts.get('cpu_threads', 0) * _cores + _cpu_count = self._facts.get('cpu_count', 1) + _cores = self._facts.get('cpu_cores', 0) * _cpu_count + _threads = self._facts.get('cpu_threads', 0) * _cpu_count self.os = self._facts.get('operating_system', 'N/A') self.cpu_summary = f"{_cores}C/{_threads}T" if _cores > 0 else 'N/A'