mirror of
https://github.com/ceph/ceph
synced 2024-12-17 17:05:42 +00:00
mon: make ceph tell mon.* version work
Fixes: #6767 Signed-off-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
parent
3f83e88008
commit
11891383ae
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user