From: Patrick Donnelly Date: Fri, 18 Jan 2019 04:08:53 +0000 (-0800) Subject: mon: implement hiding commands in ceph tool X-Git-Tag: v14.1.0~341^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26019%2Fhead;p=ceph.git mon: implement hiding commands in ceph tool Otherwise ceph.in doing get_command_descriptions sees the command does not exist and will print an error. Fixes: https://tracker.ceph.com/issues/37956 Signed-off-by: Patrick Donnelly --- diff --git a/src/ceph.in b/src/ceph.in index ffde04479357..eff2a59a945c 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -43,6 +43,7 @@ FLAG_NOFORWARD = (1 << 0) FLAG_OBSOLETE = (1 << 1) FLAG_DEPRECATED = (1 << 2) FLAG_POLL = (1 << 4) +FLAG_HIDDEN = (1 << 5) # priorities from src/common/perf_counters.h PRIO_CRITICAL = 10 @@ -477,7 +478,7 @@ def format_help(cmddict, partial=None): if not cmd['help']: continue flags = cmd.get('flags', 0) - if flags & (FLAG_OBSOLETE | FLAG_DEPRECATED): + if flags & (FLAG_OBSOLETE | FLAG_DEPRECATED | FLAG_HIDDEN): continue concise = concise_sig(cmd['sig']) if partial and not concise.startswith(partial): diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 5c7a92017791..bbc13f9dc4a5 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3112,9 +3112,7 @@ void Monitor::handle_command(MonOpRequestRef op) paxos_service[PAXOS_MGR].get())->get_command_descs(); for (auto& c : leader_mon_commands) { - if (!c.is_hidden()) { - commands.push_back(c); - } + commands.push_back(c); } auto features = m->get_connection()->get_features();