]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
orchestrator: Fix representation of threads in host ls 54977/head
authorPaul Cuzner <pcuzner@ibm.com>
Wed, 20 Dec 2023 23:47:51 +0000 (18:47 -0500)
committerPaul Cuzner <pcuzner@ibm.com>
Wed, 20 Dec 2023 23:47:51 +0000 (18:47 -0500)
This patch fixes the calculation when determining the
number of threads for hosts when using the --detail
parameter.

Signed-off-by: Paul Cuzner <pcuzner@ibm.com>
src/pybind/mgr/orchestrator/module.py

index d6f36e81b718b355b9cb70f5c490ad2f979e3265..d14c84ec18383bd7a2286a5c3fc3aea27e19f300 100644 (file)
@@ -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'