]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
node-proxy: normalize storage data per member
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 10 Feb 2026 14:46:03 +0000 (15:46 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 18 Feb 2026 08:52:38 +0000 (09:52 +0100)
Let's apply normalize_dict() to each member's data only, so the first
level keys (that are redfish member identifiers like "Self") are not
lowercased.

This avoids duplicate entries in hardware status.

Example:

```
[root@node-proxy-1 cephadm]# ./cephadm shell -- ceph orch hardware status --category criticals
Inferring fsid 9d6d6012-067a-11f1-8e61-525400a04a72
Inferring config /var/lib/ceph/9d6d6012-067a-11f1-8e61-525400a04a72/mon.node-proxy-1/config
+--------------+-----------+------+--------+-------+
|     HOST     | COMPONENT | NAME | STATUS | STATE |
+--------------+-----------+------+--------+-------+
| node-proxy-1 |    self   | None |  N/A   |  N/A  |
| node-proxy-1 |    Self   | None |  N/A   |  N/A  |
+--------------+-----------+------+--------+-------+
```

Fixes: https://tracker.ceph.com/issues/74749
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py

index 17c41c55240f55254b4e44715dbd6790eb30b259..e91e589ef25418a156feeeb55a8c039887d20ea1 100644 (file)
@@ -290,7 +290,9 @@ class BaseRedfishSystem(BaseSystem):
                     for field in fields:
                         result[member][drive_id][to_snake_case(field)] = data.get(field)
                         result[member][drive_id]["entity"] = entity
-            self._sys["storage"] = normalize_dict(result)
+            # do not normalize the first level of the dictionary
+            result[member] = normalize_dict(result[member])
+            self._sys["storage"] = result
 
     def _update_sn(self) -> None:
         serials: List[str] = []