]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: implement hiding commands in ceph tool 26019/head
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 18 Jan 2019 04:08:53 +0000 (20:08 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 18 Jan 2019 04:12:10 +0000 (20:12 -0800)
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 <pdonnell@redhat.com>
src/ceph.in
src/mon/Monitor.cc

index ffde044793575ec6314a9de7a244438e7f1a3654..eff2a59a945cd42a89a22ce12128da5b11b8864e 100755 (executable)
@@ -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):
index 5c7a92017791aa95c2379ec3b5c4dcc537d8f345..bbc13f9dc4a578868e9f03519efa6d88b79035a6 100644 (file)
@@ -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();