From: Nathan Cutler Date: Wed, 6 May 2015 09:18:50 +0000 (+0200) Subject: mon: osd find / metadata --format plain fallback X-Git-Tag: SES1-maint01~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d338609f6e7afbdcc2ff520617e081e4eeb81bf0;p=ceph.git 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 --- 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)