Bug #44089
open
mon: --format=json does not work for config get or show
Added by Patrick Donnelly about 4 years ago.
Updated 9 months ago.
Description
In addition to the json output not working, when giving either these commands a specific key to fetch:
$ ceph config show mds.a client_snapdir --format=json
.snap
or
$ bin/ceph config get mds client_snapdir --format=json
.snap
A mysterious newline is prepended to the output with --format=json but not without.
- Project changed from CephFS to RADOS
- Priority changed from Normal to High
- Component(RADOS) Monitor added
- Description updated (diff)
- Status changed from New to Fix Under Review
- Pull request ID set to 33255
- Tags set to low-hanging-fruit
- Priority changed from High to Normal
- Status changed from Fix Under Review to New
- Translation missing: en.field_tag_list set to low-hanging-fruit
- Tags deleted (
low-hanging-fruit)
- Translation missing: en.field_tag_list changed from low-hanging-fruit to low-hanging-fruit, open-source-day
- Target version changed from v15.0.0 to v18.2.0
- Target version deleted (
v18.2.0)
- Assignee set to Leonid Usov
- Description updated (diff)
as for the mysterious newline in front of the json output, here's the root cause from src/ceph.in:1275
# hack: old code printed status line before many json outputs
# (osd dump, etc.) that consumers know to ignore. Add blank line
# to satisfy consumers that skip the first line, but not annoy
# consumers that don't.
if parsed_args.output_format and \
parsed_args.output_format.startswith('json'):
print()
this newline is present in all cases when --format=json*
is given. We will need a separate ticket if we want to get rid of this.
- Pull request ID changed from 33255 to 52882
- Status changed from New to Fix Under Review
Also available in: Atom
PDF