From 9f80520670e72f9b34f362db74acade464766e5a Mon Sep 17 00:00:00 2001 From: Neha Ojha Date: Sat, 5 Dec 2020 01:22:11 +0000 Subject: [PATCH] mon, messages: use TOPNSPC::common for crimson compatibility Signed-off-by: Neha Ojha --- src/messages/MMonCommand.h | 12 +++++++----- src/messages/MMonCommandAck.h | 12 +++++++----- src/mon/Monitor.h | 6 +++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/messages/MMonCommand.h b/src/messages/MMonCommand.h index b2540ebffd087..494d5cf5606b6 100644 --- a/src/messages/MMonCommand.h +++ b/src/messages/MMonCommand.h @@ -15,12 +15,14 @@ #ifndef CEPH_MMONCOMMAND_H #define CEPH_MMONCOMMAND_H -#include "common/cmdparse.h" #include "messages/PaxosServiceMessage.h" #include #include +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; @@ -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 { diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index edfb94ab81dbc..38423548c6ecd 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -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"; -- 2.39.5