mon: make ceph tell mon.* version work

Fixes: #6767
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
Mykola Golub 2014-12-29 10:05:28 +02:00
parent 3f83e88008
commit 11891383ae
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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: