]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: make mgr commands compat with pre-quincy mon
authorSage Weil <sage@newdream.net>
Sat, 29 May 2021 02:19:27 +0000 (22:19 -0400)
committerSage Weil <sage@newdream.net>
Fri, 4 Jun 2021 20:56:17 +0000 (16:56 -0400)
If the mon is not yet quincy, do not share the quincy-ism of
'positional=false'.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mgr/MgrStandby.cc

index 1ba6eaea4f61e92d69e8c9a96a93fd6e06ea0671..14d95ab5158b4fae146393c41b420c50bce1c81b 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <Python.h>
+#include <boost/algorithm/string/replace.hpp>
 
 #include "common/errno.h"
 #include "common/signal.h"
@@ -258,6 +259,12 @@ void MgrStandby::send_beacon()
       std::vector<MonCommand> commands = mgr_commands;
       std::vector<MonCommand> py_commands = py_module_registry.get_commands();
       commands.insert(commands.end(), py_commands.begin(), py_commands.end());
+      if (monc.monmap.min_mon_release < ceph_release_t::quincy) {
+       dout(10) << " stripping out positional=false quincy-ism" << dendl;
+       for (auto& i : commands) {
+         boost::replace_all(i.cmdstring, ",positional=false", "");
+       }
+      }
       m->set_command_descs(commands);
       dout(4) << "going active, including " << m->get_command_descs().size()
               << " commands in beacon" << dendl;