From d338609f6e7afbdcc2ff520617e081e4eeb81bf0 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Wed, 6 May 2015 11:18:50 +0200 Subject: [PATCH] mon: osd find / metadata --format plain fallback ceph --format plain osd find 1 (and metadata) are not implemented and must fallback to the default (json-pretty). http://tracker.ceph.com/issues/9538 Fixes: #9538 Signed-off-by: Loic Dachary (cherry picked from commit 13780d7) Rebased to omit the modifications to qa/workunits/cephtool/test.sh so the patch will apply to the upstream tarball. Signed-off-by: Nathan Cutler --- src/mon/OSDMonitor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index da06b86beb1d..7edda2964b86 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2297,6 +2297,8 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) string format; cmd_getval(g_ceph_context, cmdmap, "format", format, string("json-pretty")); boost::scoped_ptr f(new_formatter(format)); + if (!f) + f.reset(new_formatter("json-pretty")); f->open_object_section("osd_location"); f->dump_int("osd", osd); @@ -2324,6 +2326,8 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) string format; cmd_getval(g_ceph_context, cmdmap, "format", format, string("json-pretty")); boost::scoped_ptr f(new_formatter(format)); + if (!f) + f.reset(new_formatter("json-pretty")); f->open_object_section("osd_metadata"); r = dump_osd_metadata(osd, f.get(), &ss); if (r < 0) -- 2.47.3