]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon, messages: use TOPNSPC::common for crimson compatibility 38620/head
authorNeha Ojha <nojha@redhat.com>
Sat, 5 Dec 2020 01:22:11 +0000 (01:22 +0000)
committerNathan Cutler <ncutler@suse.com>
Thu, 17 Dec 2020 17:50:03 +0000 (18:50 +0100)
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 9f80520670e72f9b34f362db74acade464766e5a)

Conflicts:
src/messages/MMonCommand.h
- in master, class declaration has "final" qualifier which is missing in octopus
src/messages/MMonCommandAck.h
- in master, class declaration has "final" qualifier which is missing in octopus

src/messages/MMonCommand.h
src/messages/MMonCommandAck.h
src/mon/Monitor.h

index d3925c2dba20f0f72ab4dd2f07aaeec05f645501..4819eddbb8e1ca924ad9632c0bee32fcf3c7c772 100644 (file)
 #ifndef CEPH_MMONCOMMAND_H
 #define CEPH_MMONCOMMAND_H
 
-#include "common/cmdparse.h"
 #include "messages/PaxosServiceMessage.h"
 
 #include <vector>
 #include <string>
 
+using TOPNSPC::common::cmdmap_from_json;
+using TOPNSPC::common::cmd_getval;
+
 class MMonCommand : public PaxosServiceMessage {
 public:
   // weird note: prior to octopus, MgrClient would leave fsid blank when
@@ -45,17 +47,17 @@ public:
     cmdmap_t cmdmap;
     stringstream ss;
     string prefix;
-    ceph::common::cmdmap_from_json(cmd, &cmdmap, ss);
-    ceph::common::cmd_getval(cmdmap, "prefix", prefix);
+    cmdmap_from_json(cmd, &cmdmap, ss);
+    cmd_getval(cmdmap, "prefix", prefix);
     // Some config values contain sensitive data, so don't log them
     o << "mon_command(";
     if (prefix == "config set") {
       string name;
-      ceph::common::cmd_getval(cmdmap, "name", name);
+      cmd_getval(cmdmap, "name", name);
       o << "[{prefix=" << prefix << ", name=" << name << "}]";
     } else if (prefix == "config-key set") {
       string key;
-      ceph::common::cmd_getval(cmdmap, "key", key);
+      cmd_getval(cmdmap, "key", key);
       o << "[{prefix=" << prefix << ", key=" << key << "}]";
     } else {
       for (unsigned i=0; i<cmd.size(); i++) {
index dedf78bb03c88af47d6c6f301c73f6135d659103..c28441e6d01bc25c10cfd77a8a9be8e836330ff6 100644 (file)
 #ifndef CEPH_MMONCOMMANDACK_H
 #define CEPH_MMONCOMMANDACK_H
 
-#include "common/cmdparse.h"
 #include "messages/PaxosServiceMessage.h"
 
+using TOPNSPC::common::cmdmap_from_json;
+using TOPNSPC::common::cmd_getval;
+
 class MMonCommandAck : public PaxosServiceMessage {
 public:
   std::vector<std::string> cmd;
@@ -37,19 +39,19 @@ public:
     cmdmap_t cmdmap;
     stringstream ss;
     string prefix;
-    ceph::common::cmdmap_from_json(cmd, &cmdmap, ss);
-    ceph::common::cmd_getval(cmdmap, "prefix", prefix);
+    cmdmap_from_json(cmd, &cmdmap, ss);
+    cmd_getval(cmdmap, "prefix", prefix);
     // Some config values contain sensitive data, so don't log them
     o << "mon_command_ack(";
     if (prefix == "config set") {
       string name;
-      ceph::common::cmd_getval(cmdmap, "name", name);
+      cmd_getval(cmdmap, "name", name);
       o << "[{prefix=" << prefix
         << ", name=" << name << "}]"
         << "=" << r << " " << rs << " v" << version << ")";
     } else if (prefix == "config-key set") {
       string key;
-      ceph::common::cmd_getval(cmdmap, "key", key);
+      cmd_getval(cmdmap, "key", key);
       o << "[{prefix=" << prefix << ", key=" << key << "}]"
         << "=" << r << " " << rs << " v" << version << ")";
     } else {
index 29c3a13be60dd2746906384bb33d88366a47e78d..deda57a93dd9da2f1c77add479a57ccc80be19e1 100644 (file)
@@ -41,7 +41,6 @@
 #include "MonCommand.h"
 
 
-#include "common/cmdparse.h"
 #include "common/config_obs.h"
 #include "common/LogClient.h"
 #include "auth/AuthClient.h"
@@ -57,6 +56,7 @@
 #include "mon/MonOpRequest.h"
 #include "common/WorkQueue.h"
 
+using namespace TOPNSPC::common;
 
 #define CEPH_MON_PROTOCOL     13 /* cluster internal */
 
@@ -843,8 +843,8 @@ public:
         cmdmap_t cmdmap;
         stringstream ds;
         string prefix;
-        ceph::common::cmdmap_from_json(m->cmd, &cmdmap, ds);
-        ceph::common::cmd_getval(cmdmap, "prefix", prefix);
+        cmdmap_from_json(m->cmd, &cmdmap, ds);
+        cmd_getval(cmdmap, "prefix", prefix);
         if (prefix != "config set" && prefix != "config-key set")
           ss << "cmd='" << m->cmd << "': finished";