From: xie xingguo Date: Mon, 3 Jul 2017 11:16:49 +0000 (+0800) Subject: mon/OSDMonitor: add more wildcards support for scrub and fix description X-Git-Tag: v12.1.1~119^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=722b27cd12ece9fef4681a8844e7814848a26f61;p=ceph.git mon/OSDMonitor: add more wildcards support for scrub and fix description Signed-off-by: xie xingguo --- diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index afb156c728f..e6b3100f09d 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -635,7 +635,7 @@ bool DaemonServer::handle_command(MCommand *m) get_str_vec(prefix, pvec); set osds; - if (whostr == "*") { + if (whostr == "*" || whostr == "all" || whostr == "any") { cluster_state.with_osdmap([&](const OSDMap& osdmap) { for (int i = 0; i < osdmap.get_max_osd(); i++) if (osdmap.is_up(i)) { diff --git a/src/mgr/MgrCommands.h b/src/mgr/MgrCommands.h index 7df74d730fa..91886a2d2fe 100644 --- a/src/mgr/MgrCommands.h +++ b/src/mgr/MgrCommands.h @@ -100,10 +100,13 @@ COMMAND("osd test-reweight-by-pg " \ COMMAND("osd scrub " \ "name=who,type=CephString", \ - "initiate scrub on osd ", "osd", "rw", "cli,rest") + "initiate scrub on osd , or use to scrub all", \ + "osd", "rw", "cli,rest") COMMAND("osd deep-scrub " \ "name=who,type=CephString", \ - "initiate deep scrub on osd ", "osd", "rw", "cli,rest") + "initiate deep scrub on osd , or use to deep scrub all", \ + "osd", "rw", "cli,rest") COMMAND("osd repair " \ "name=who,type=CephString", \ - "initiate repair on osd ", "osd", "rw", "cli,rest") + "initiate repair on osd , or use to repair all", \ + "osd", "rw", "cli,rest") diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 8f5e12c04a3..200daa26b9f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4212,15 +4212,15 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op) } goto reply; - } else if ((prefix == "osd scrub" || - prefix == "osd deep-scrub" || - prefix == "osd repair")) { + } else if (prefix == "osd scrub" || + prefix == "osd deep-scrub" || + prefix == "osd repair") { string whostr; cmd_getval(g_ceph_context, cmdmap, "who", whostr); vector pvec; get_str_vec(prefix, pvec); - if (whostr == "*") { + if (whostr == "*" || whostr == "all" || whostr == "any") { ss << "osds "; int c = 0; for (int i = 0; i < osdmap.get_max_osd(); i++)