]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/node-proxy: handle 'None' statuses returned by RedFish 55955/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 09:09:34 +0000 (09:09 +0000)
commitcc279a3dd23d9219e508b80512f363a4ae577392
tree7511b0c87160e2a1a697cdbbd9e90cd129d5f62d
parentb420380bdad08f55a9034a5814f6b2d69ca5837b
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>
src/ceph-node-proxy/ceph_node_proxy/util.py
src/pybind/mgr/cephadm/inventory.py