]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon, messages: use TOPNSPC::common for crimson compatibility 38479/head
authorNeha Ojha <nojha@redhat.com>
Sat, 5 Dec 2020 01:22:11 +0000 (01:22 +0000)
committerNeha Ojha <nojha@redhat.com>
Tue, 15 Dec 2020 16:02:15 +0000 (16:02 +0000)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/messages/MMonCommand.h
src/messages/MMonCommandAck.h
src/mon/Monitor.h

index b2540ebffd0878f9a31c6bf4b2a8af892b0c7c34..494d5cf5606b6a7a77e8f46d00ed52e4f77be4a0 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 final : public PaxosServiceMessage {
 public:
   // weird note: prior to octopus, MgrClient would leave fsid blank when
@@ -45,17 +47,17 @@ public:
     cmdmap_t cmdmap;
     std::ostringstream 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 24117556a93592ea15b9a4d808e4935a0f88ad67..b49e8bcffdbbed65f72533ac4a4fe5e6b1e42b3b 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 final : public PaxosServiceMessage {
 public:
   std::vector<std::string> cmd;
@@ -37,19 +39,19 @@ public:
     cmdmap_t cmdmap;
     std::ostringstream 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 edfb94ab81dbc90a5e1a1ad773fe85916be3f4f3..38423548c6ecd97e3b09a3e33dae816a1f0d79e4 100644 (file)
@@ -42,7 +42,6 @@
 #include "MonCommand.h"
 
 
-#include "common/cmdparse.h"
 #include "common/config_obs.h"
 #include "common/LogClient.h"
 #include "auth/AuthClient.h"
@@ -58,6 +57,7 @@
 #include "mon/MonOpRequest.h"
 #include "common/WorkQueue.h"
 
+using namespace TOPNSPC::common;
 
 #define CEPH_MON_PROTOCOL     13 /* cluster internal */
 
@@ -873,8 +873,8 @@ public:
         cmdmap_t cmdmap;
         std::ostringstream 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";