.Calamari sometimes incorrectly outputs "null" as a value
When the Calamari REST-based API is used to get details of a CRUSH rule in the Ceph cluster, the output contains "null" as a value for certain fields in the `steps` section of the CRUSH rule. The fields containing null values can be safely ignored for the respective steps in the CRUSH rule. However, do not use "null" as a value for any field when doing a PATCH operation. Using null values in such a case causes the operation to fail.
Description of problem:
-----------------------
A GET of Crush rule lists some values as null for the "steps".
"steps": [
{
"op": "take",
"type": null,
"num": null,
"item_name": "default",
"item": -1
},
{
"op": "chooseleaf_firstn",
"type": "host",
"num": 0,
"item_name": null,
"item": null
},
{
"op": "emit",
"type": null,
"num": null,
"item_name": null,
"item": null
}
But the CLI the command " ceph osd crush rule dump" does not list that way. It lists as follows:
"steps": [
{
"op": "take",
"item": -1,
"item_name": "default"
},
{
"op": "chooseleaf_firstn",
"num": 0,
"type": "host"
},
{
"op": "emit"
}
Version-Release number of selected component (if applicable):
ceph version 10.2.1-7.el7cp (339d1fb5d73e5f113c8538a45e95b3777038da36)
calamari-server-1.4.0-0.10.rc13.el7cp.x86_64
How reproducible: always
Steps to Reproduce:
1. invoke https://<mon-ip>:8002/api/v2/cluster/<fs id>/crush_rule
Actual results:
Displays null for few values under "steps" section.
Expected results:
Should not display null values
Additional info:
The PATCH operation fails if we use null values
Description of problem: ----------------------- A GET of Crush rule lists some values as null for the "steps". "steps": [ { "op": "take", "type": null, "num": null, "item_name": "default", "item": -1 }, { "op": "chooseleaf_firstn", "type": "host", "num": 0, "item_name": null, "item": null }, { "op": "emit", "type": null, "num": null, "item_name": null, "item": null } But the CLI the command " ceph osd crush rule dump" does not list that way. It lists as follows: "steps": [ { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_firstn", "num": 0, "type": "host" }, { "op": "emit" } Version-Release number of selected component (if applicable): ceph version 10.2.1-7.el7cp (339d1fb5d73e5f113c8538a45e95b3777038da36) calamari-server-1.4.0-0.10.rc13.el7cp.x86_64 How reproducible: always Steps to Reproduce: 1. invoke https://<mon-ip>:8002/api/v2/cluster/<fs id>/crush_rule Actual results: Displays null for few values under "steps" section. Expected results: Should not display null values Additional info: The PATCH operation fails if we use null values