Project

General

Profile

Actions

Bug #44089

open

mon: --format=json does not work for config get or show

Added by Patrick Donnelly about 4 years ago. Updated 8 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Monitor
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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.

Actions #1

Updated by Patrick Donnelly about 4 years ago

  • Project changed from CephFS to RADOS
  • Priority changed from Normal to High
  • Component(RADOS) Monitor added
Actions #2

Updated by Patrick Donnelly about 4 years ago

  • Description updated (diff)
Actions #3

Updated by Kefu Chai about 4 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 33255
Actions #4

Updated by Neha Ojha over 3 years ago

  • Tags set to low-hanging-fruit
Actions #5

Updated by Neha Ojha about 2 years ago

  • Priority changed from High to Normal
Actions #6

Updated by Laura Flores over 1 year ago

  • Status changed from Fix Under Review to New

This would be a good issue for Open Source Day if someone would be willing to take over the closed PR: https://github.com/ceph/ceph/pull/33255

Actions #7

Updated by Laura Flores over 1 year ago

  • Translation missing: en.field_tag_list set to low-hanging-fruit
Actions #8

Updated by Laura Flores over 1 year ago

  • Tags deleted (low-hanging-fruit)
Actions #9

Updated by Laura Flores 10 months ago

  • 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
Actions #10

Updated by Ilya Dryomov 9 months ago

  • Target version deleted (v18.2.0)
Actions #11

Updated by Leonid Usov 9 months ago

  • Assignee set to Leonid Usov
Actions #12

Updated by Patrick Donnelly 9 months ago

  • Description updated (diff)
Actions #13

Updated by Leonid Usov 8 months ago

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.

Actions #14

Updated by Leonid Usov 8 months ago

  • Pull request ID changed from 33255 to 52882
Actions #15

Updated by Leonid Usov 8 months ago

  • Status changed from New to Fix Under Review
Actions

Also available in: Atom PDF