]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
node-proxy: update the data structure for summary report
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 28 Nov 2023 16:28:46 +0000 (16:28 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 25 Jan 2024 15:07:20 +0000 (15:07 +0000)
This extends the current data structure for the 'summary' report.
It adds `sn` (serial number information) and the `firmwares` dict
to the current data structure.

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

index 15e81fa57f40e5b2f41bd995666b880d00859637..27bf55c921c38b4facde31882d69c23c19270745 100644 (file)
@@ -1481,11 +1481,14 @@ class NodeProxyCache:
 
         for host in hosts:
             _result[host] = {}
+            _result[host]['status'] = {}
             data = self.data[host]
             for component, details in data['status'].items():
                 res = any([member['status']['health'].lower() != 'ok' for member in data['status'][component].values()])
-                _result[host][component] = mapper[res]
-
+                _result[host]['status'][component] = mapper[res]
+            _result[host]['sn'] = data['sn']
+            _result[host]['host'] = data['host']
+            _result[host]['firmwares'] = data['firmwares']
         return _result
 
     def common(self, endpoint: str, **kw: Any) -> Dict[str, Any]:
index 1bf86a65dd89b0b3c02568411eaf7a62db7ec5dd..648cdc179c0f647fc5522f02879abb7b0261b99a 100644 (file)
@@ -1684,7 +1684,7 @@ Then run the following:
             data = self.node_proxy.summary(hostname=hostname)
             for k, v in data.items():
                 row = [k]
-                row.extend([v[key] for key in ['storage', 'processors', 'network', 'memory', 'power', 'fans']])
+                row.extend([v['status'][key] for key in ['storage', 'processors', 'network', 'memory', 'power', 'fans']])
                 table.add_row(row)
             output = table.get_string()
         elif category == 'firmwares':