From 0684ab14a4c59e7d46540b5867f5b7ffd819f879 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 17 Jan 2019 20:08:53 -0800 Subject: [PATCH] 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 --- src/ceph.in | 3 ++- src/mon/Monitor.cc | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index ffde0447935..eff2a59a945 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 5c7a9201779..bbc13f9dc4a 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();