From: Kefu Chai Date: Tue, 19 Nov 2019 02:55:22 +0000 (+0800) Subject: mon: refuse to execute obsoleted tell commands X-Git-Tag: v15.1.0~359^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9fcc7e0d8bb3c6fbd5d1ee3c83a5372dafac2587;p=ceph-ci.git mon: refuse to execute obsoleted tell commands we need to stop executing obsoleted tell commands. it helps us to deprecate and remove unsupported command over time. Signed-off-by: Kefu Chai --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 5baa2c9b551..f34cc1c55c8 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -3190,6 +3190,17 @@ void Monitor::handle_tell_command(MonOpRequestRef op) if (!cmd_getval(g_ceph_context, cmdmap, "prefix", prefix)) { return reply_tell_command(op, -EINVAL, "no prefix"); } + if (auto cmd = _get_moncommand(prefix, + get_local_commands(quorum_mon_features)); + cmd) { + if (cmd->is_obsolete() || + (cct->_conf->mon_debug_deprecated_as_obsolete && + cmd->is_deprecated())) { + return reply_tell_command(op, -ENOTSUP, + "command is obsolete; " + "please check usage and/or man page"); + } + } // see if command is whitelisted if (!session->caps.is_capable( g_ceph_context,