]> 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:16:17 +0000 (15:16 +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>
(cherry picked from commit 61d07e0a441aafd84a463868f777d6091f6e92fe)

src/pybind/mgr/cephadm/inventory.py
src/pybind/mgr/cephadm/module.py

index 0446dc49f8d5091ee9ba3d684ac633e79b2c54b9..a5003d5e657fd12bb87b301cee51391bfd9fb458 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 9add893f04b00c0203406ea8e39d6f8aff83ca4e..4b0fa809f663b59f32aa4315142d4171d522ba70 100644 (file)
@@ -1668,7 +1668,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':