From 7f1bf96fddc979e11329f555c43555a44e85d2cc Mon Sep 17 00:00:00 2001 From: Paul Cuzner Date: Wed, 20 Dec 2023 18:47:51 -0500 Subject: [PATCH] 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) --- src/pybind/mgr/orchestrator/module.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/orchestrator/module.py b/src/pybind/mgr/orchestrator/module.py index 054cd58f8b0..e0a89ecadcf 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' -- 2.39.5