]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/node-proxy: handle 'None' statuses returned by RedFish 55998/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Tue, 5 Mar 2024 10:05:18 +0000 (10:05 +0000)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 6 Mar 2024 13:52:38 +0000 (13:52 +0000)
commit1696e40c2c22d391e5247f74d4c5fd96c4c8cf6a
tree5bf92e9a72c84b4f042b809cb2265f0baa721077
parentcd88ef71e0858ead8f038dea9804376b3b0f97a5
mgr/node-proxy: handle 'None' statuses returned by RedFish

Looks like RedFish might return 'None' values for some attributes.

for instance:

```
[root@ceph-node-01 ~]# curl -s -k -X GET https://169.254.1.1/redfish/v1/Systems/System.Embedded.1/Storage/AHCI.SL.6-1/Drives/Disk.Direct.0-0:AHCI.SL.6-1 -H "X-Auth-Token: 3264251c28191fa5e7c9ebec49ef90fc"  | jq .Status
{
  "Health": "OK",
  "HealthRollup": "OK",
  "State": "Enabled"
}
[root@ceph-node-01 ~]# curl -s -k -X GET https://169.254.1.1/redfish/v1/Systems/System.Embedded.1/Storage/NonRAID.Slot.2-1/Drives/Disk.Bay.0:Enclosure.Internal.0-1:NonRAID.Slot.2-1 -H "X-Auth-Token: 3264251c28191fa5e7c9ebec49ef90fc" | jq .Status
{
  "Health": null,
  "HealthRollup": null,
  "State": "Enabled"
}
[root@ceph-node-01 ~]#
```

Although this seems to be a bug from RedFish, we need to handle
the case when it happens otherwise it makes the mgr orchestrator module
throw an error.

The idea here is to create a new status "unknown" when we can't fetch the
real status of a component.

Fixes: https://tracker.ceph.com/issues/64712
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit cc279a3dd23d9219e508b80512f363a4ae577392)
src/ceph-node-proxy/ceph_node_proxy/util.py
src/pybind/mgr/cephadm/inventory.py