Bug #38011
closed[Mimic version]extra null list in json output of command: ceph osd crush tree --format=json-pretty
0%
Description
When executing below command to get osd crush tree on Mimic version, it will output extra null list[] which makes json.loads(result) failed:
1. ceph osd crush tree --format=json-pretty
[
{
"id": -1,
"name": "default",
"type": "root",
"type_id": 10,
"children": []
}
]
[]
2. ceph osd crush tree --format=json
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]
Example when doing json load example:
bug_str = '[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]'
json.loads(bug_str)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 369, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 70 - line 1 column 72 (char 69 - 71)
good_str = '[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]'
json.loads(good_str)
[{u'children': [], u'type_id': 10, u'type': u'root', u'id': -1, u'name': u'default'}]
Updated by Changcheng Liu over 5 years ago
The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]*[]*
Updated by Changcheng Liu over 5 years ago
Changcheng Liu wrote:
The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}]*[]*
Updated by Changcheng Liu over 5 years ago
Changcheng Liu wrote:
Changcheng Liu wrote:
The extra null list should be removed
[{"id":-1,"name":"default","type":"root","type_id":10,"children":[]}][]
Updated by Vasu Kulkarni over 5 years ago
- Project changed from 18 to RADOS
- Affected Versions v13.0.0 added
Not a ceph-deploy issue but should fall under ceph
Updated by Noah Watkins about 5 years ago
Looks like this was from running an old monitor, and should be fixed in newer release.