From 38a3f50c5829b36378a9b3af4ac121f9ece0c391 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 17 Jan 2018 14:09:41 -0600 Subject: [PATCH] mon/ConfigMonitor: indent 'config dump' Signed-off-by: Sage Weil --- src/mon/ConfigMonitor.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index 6c29e554034..cf412e1985a 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -91,6 +91,17 @@ 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) { MMonCommand *m = static_cast(op->get_req()); @@ -155,7 +166,7 @@ bool ConfigMonitor::preprocess_command(MonOpRequestRef op) for (auto s : sections) { for (auto& i : s.second->options) { if (!f) { - tbl << s.first; + tbl << indent_who(s.first); tbl << i.second.mask.to_str(); tbl << Option::level_to_str(i.second.opt->level); tbl << i.first; -- 2.39.5