]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/DaemonServer: make 'config show' indicate duplicate overrides
authorSage Weil <sage@redhat.com>
Sat, 6 Jan 2018 03:39:10 +0000 (21:39 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:48 +0000 (14:44 -0600)
If we override an option with the same value, show the OVERRIDES item
in parenthesis.  (I tried "=$src" and "(=$src)" but neither looked any
better.)

Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc

index e6b0459e5773f794ee55f3ae9644eaeba2f8e30f..53b3d4edc3e0fb05515a68da110e6835d096d084 100644 (file)
@@ -1400,7 +1400,12 @@ bool DaemonServer::handle_command(MCommand *m)
              list<string> ov;
              auto j = i.second.rend();
              for (--j; j != i.second.rbegin(); --j) {
-               ov.push_front(ceph_conf_level_name(j->first));
+               if (j->second == i.second.rbegin()->second) {
+                 ov.push_front(string("(") + ceph_conf_level_name(j->first) +
+                               string(")"));
+               } else {
+                 ov.push_front(ceph_conf_level_name(j->first));
+               }
              }
              tbl << ov;
            }
@@ -1449,7 +1454,12 @@ bool DaemonServer::handle_command(MCommand *m)
                list<string> ov;
                auto k = j->second.rend();
                for (--k; k != j->second.rbegin(); --k) {
-                 ov.push_front(ceph_conf_level_name(k->first));
+                 if (k->second == j->second.rbegin()->second) {
+                   ov.push_front(string("(") + ceph_conf_level_name(k->first) +
+                                 string(")"));
+                 } else {
+                   ov.push_front(ceph_conf_level_name(k->first));
+                 }
                }
                tbl << ov;
              }