]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigMonitor: indent 'config dump'
authorSage Weil <sage@redhat.com>
Wed, 17 Jan 2018 20:09:41 +0000 (14:09 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:49 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/ConfigMonitor.cc

index 6c29e55403472642fa9114dd46dad39909bcbc30..cf412e1985ab6793ffeaa4c0e52216a30d0be767 100644 (file)
@@ -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<MMonCommand*>(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;