]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: drop old _allowed_command()
authorSage Weil <sage@inktank.com>
Fri, 2 Aug 2013 22:17:02 +0000 (15:17 -0700)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 6 Aug 2013 20:59:33 +0000 (13:59 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index e227bf823abd94362020a1d19e107461a621aea0..33b959f27275014d2785913d0084e8d95a168b19 100644 (file)
@@ -1535,47 +1535,6 @@ void Monitor::finish_election()
 }
 
 
-bool Monitor::_allowed_command(MonSession *s, map<string, cmd_vartype>& cmd)
-{
-  bool retval = false;
-
-  if (s->caps.is_allow_all()) {
-    dout(10) << __func__ << " allow_all" << dendl;
-    return true;
-  }
-
-  string prefix;
-  cmd_getval(g_ceph_context, cmd, "prefix", prefix);
-
-  map<string,string> strmap;
-  for (map<string, cmd_vartype>::const_iterator p = cmd.begin();
-       p != cmd.end(); ++p) {
-    if (p->first == "prefix")
-      continue;
-    if (p->first == "caps") {
-      vector<string> cv;
-      if (cmd_getval(g_ceph_context, cmd, "caps", cv) &&
-         cv.size() % 2 == 0) {
-       for (unsigned i = 0; i < cv.size(); i += 2) {
-         string k = string("caps_") + cv[i];
-         strmap[k] = cv[i + 1];
-       }
-       continue;
-      }
-    }
-    strmap[p->first] = cmd_vartype_stringify(p->second);
-  }
-
-  dout(20) << __func__ << " strmap " << strmap << dendl;
-  if (s->caps.is_capable(g_ceph_context, s->inst.name,
-                        "", prefix, strmap, false, false, true)) {
-    retval = true; 
-  }
-
-  dout(10) << __func__ << " = " << retval << dendl;
-  return retval;
-}
-
 void Monitor::sync_force(Formatter *f, ostream& ss)
 {
   bool free_formatter = false;
index c76b8a47d4fab7a464734fc550d511dbb5e1d7a5..e39ffc203789c96bdbe26c9cf5d05049631873dc 100644 (file)
@@ -583,7 +583,6 @@ public:
   void handle_get_version(MMonGetVersion *m);
   void handle_subscribe(MMonSubscribe *m);
   void handle_mon_get_map(MMonGetMap *m);
-  bool _allowed_command(MonSession *s, map<std::string, cmd_vartype>& cmd);
   bool _allowed_command(MonSession *s, string &module, string& prefix,
                         map<string,cmd_vartype>& cmdmap);
   void _mon_status(Formatter *f, ostream& ss);