From 6160e503426fffee0044029c9746c0af01594d2d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 12 Jun 2013 16:56:45 -0700 Subject: [PATCH] mon: remove support for 'mon tell ...' and 'osd tell ...' It doesn't work. The commands the ceph cli sends are vector, and the mon expects json. Leave the MDS on in place since ceph-mds still takes strings. Signed-off-by: Sage Weil --- src/mon/MonCommands.h | 8 ------- src/mon/MonmapMonitor.cc | 47 ---------------------------------------- 2 files changed, 55 deletions(-) diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 4e64a0a70d497..bc6bc18f6a3cc 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -259,10 +259,6 @@ COMMAND("mon stat", "summarize monitor status") COMMAND("mon getmap " \ "name=epoch,type=CephInt,range=0,req=false", \ "get monmap") -COMMAND("mon tell " \ - "name=who,type=CephString " \ - "name=args,type=CephString,n=N", \ - "send command to specific monitor(s)") COMMAND("mon add " \ "name=name,type=CephString " \ "name=addr,type=CephIPAddr", \ @@ -289,10 +285,6 @@ COMMAND("osd getcrushmap " \ "name=epoch,type=CephInt,range=0,req=false", \ "get CRUSH map") COMMAND("osd getmaxosd", "show largest OSD id") -COMMAND("osd tell " \ - "name=who,type=CephString " \ - "name=args,type=CephString,n=N", \ - "send command to particular osd") COMMAND("osd find " \ "name=id,type=CephInt,range=0", \ "find osd in the CRUSH map and show its location") diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 90839b7706f01..2b5ede0b5ed30 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -264,53 +264,6 @@ bool MonmapMonitor::preprocess_command(MMonCommand *m) if (p != mon->monmap) delete p; } - } else if (prefix == "mon tell") { - dout(20) << "got tell: " << m->cmd << dendl; - string whostr; - cmd_getval(g_ceph_context, cmdmap, "who", whostr); - vector argvec; - cmd_getval(g_ceph_context, cmdmap, "args", argvec); - - if (whostr == "*") { // send to all mons and do myself - for (unsigned i = 0; i < mon->monmap->size(); ++i) { - MMonCommand *newm = new MMonCommand(m->fsid, m->version); - newm->cmd.insert(newm->cmd.begin(), argvec.begin(), argvec.end()); - mon->messenger->send_message(newm, mon->monmap->get_inst(i)); - } - ss << "bcast to all mons"; - r = 0; - } else { - // find target. Ignore error from parsing long as we probably - // have a string instead - long who = parse_pos_long(whostr.c_str(), NULL); - EntityName name; - if (who < 0) { - - // not numeric; try as name or id, and see if in monmap - if (!name.from_str(whostr)) - name.set("mon", whostr); - - if (mon->monmap->contains(name.get_id())) { - who = mon->monmap->get_rank(name.get_id()); - } else { - ss << "bad mon name \"" << whostr << "\""; - r = -ENOENT; - goto out; - } - } else if (who >= (long)mon->monmap->size()) { - ss << "mon." << whostr << " does not exist"; - r = -ENOENT; - goto out; - } - - // send to target, or handle if it's me - stringstream ss; - MMonCommand *newm = new MMonCommand(m->fsid, m->version); - newm->cmd.insert(newm->cmd.begin(), argvec.begin(), argvec.end()); - mon->messenger->send_message(newm, mon->monmap->get_inst(who)); - ss << "fw to mon." << whostr; - r = 0; - } } else if (prefix == "mon add") return false; -- 2.39.5