From e0ff3bf8894e7dc81bca5308ab511009915ad4ce Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 1 Apr 2021 14:22:07 -0500 Subject: [PATCH] mon/ConfigMonitor: do not indent 'config dump' output The indentation is misleading. For example, mgr advanced mgr/telemetry/last_opt_revision 3 * osd advanced osd_max_backfills 10 osd basic osd_memory_target 6442450944 osd advanced osd_scrub_auto_repair true mds.ar basic mds_join_fs ar client.rgw.foo basic rgw_frontends beast port=8080 * The indentation kind of implies that mds.ar (or client.whatever) is beneath 'osd', which it is not, and there rarely a 'client' scoped option to make it look right. Same problem for osd.foo etc. Also, it is IMO easier to see the nesting structure when things align naturally. e.g. global osd osd.1 osd.2 mds mds.foo mds.foo.bar client.foo.bar ... Signed-off-by: Sage Weil --- src/mon/ConfigMonitor.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index 7f0ee21e67155..f34dd0ecb2f23 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -168,17 +168,6 @@ bool ConfigMonitor::preprocess_query(MonOpRequestRef op) return false; } -static string indent_who(const string& who) -{ - if (who == "global") { - return who; - } - if (who.find('.') == string::npos) { - return " " + who; - } - return " " + who; -} - bool ConfigMonitor::preprocess_command(MonOpRequestRef op) { auto m = op->get_req(); @@ -278,7 +267,7 @@ bool ConfigMonitor::preprocess_command(MonOpRequestRef op) for (auto s : sections) { for (auto& i : s.second->options) { if (!f) { - tbl << indent_who(s.first); + tbl << s.first; tbl << i.second.mask.to_str(); tbl << Option::level_to_str(i.second.opt->level); tbl << i.first; -- 2.39.5