From a95cf66dac2c010f4aa3b146b16075de07b04556 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 5 Jan 2018 21:39:10 -0600 Subject: [PATCH] mgr/DaemonServer: make 'config show' indicate duplicate overrides 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 --- src/mgr/DaemonServer.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index e6b0459e5773f..53b3d4edc3e0f 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1400,7 +1400,12 @@ bool DaemonServer::handle_command(MCommand *m) list 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 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; } -- 2.39.5