From: Mykola Golub Date: Mon, 29 Dec 2014 08:05:28 +0000 (+0200) Subject: mon: make ceph tell mon.* version work X-Git-Tag: v0.92~63^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11891383aebf73568c044485dffb7c3de12eeeb5;p=ceph.git mon: make ceph tell mon.* version work Fixes: #6767 Signed-off-by: Mykola Golub --- diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index aa325e80d688..0aad890b8443 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -1055,7 +1055,6 @@ function test_mon_pg() # ceph tell osd.0 version expect_false ceph tell osd.9999 version - expect_false ceph tell osd.foo version # back to pg stuff diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 4e3a01b8232d..a7c6ca036006 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -227,6 +227,7 @@ COMMAND("tell " \ "name=target,type=CephName " \ "name=args,type=CephString,n=N", \ "send a command to a specific daemon", "mon", "rw", "cli,rest") +COMMAND("version", "show mon daemon version", "mon", "r", "cli,rest") /* * MDS commands (MDSMonitor.cc) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 52753a62fb4c..78e2061fe6be 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2683,6 +2683,18 @@ void Monitor::handle_command(MMonCommand *m) rs = "needs a valid 'quorum' command"; r = -EINVAL; } + } else if (prefix == "version") { + if (f) { + f->open_object_section("version"); + f->dump_string("version", pretty_version_to_str()); + f->close_section(); + f->flush(ds); + } else { + ds << pretty_version_to_str(); + } + rdata.append(ds); + rs = ""; + r = 0; } out: