From 0f7988d4f006e06c02c012c86099612dfcc10729 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 23 Mar 2017 09:31:41 -0400 Subject: [PATCH] mds: pretty json from `tell` commands The overhead of the whitespace is trivial and makes the output somewhat human readable. Previously I was always taking `damage ls` into a file and parsing it out with python. Signed-off-by: John Spray --- src/mds/MDSRank.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index eb538f9c849e..d1cb909b7545 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -2571,7 +2571,7 @@ bool MDSRankDispatcher::handle_command( return true; } - Formatter *f = new JSONFormatter(); + Formatter *f = new JSONFormatter(true); dump_sessions(filter, f); f->flush(*ds); delete f; @@ -2591,7 +2591,7 @@ bool MDSRankDispatcher::handle_command( *need_reply = false; return true; } else if (prefix == "damage ls") { - Formatter *f = new JSONFormatter(); + Formatter *f = new JSONFormatter(true); damage_table.dump(f); f->flush(*ds); delete f; -- 2.47.3