diff options
author | Sage Weil <sage@inktank.com> | 2012-12-18 20:08:42 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-12-18 20:08:42 -0800 |
commit | b2eb8bd2ede7ab53ba0660f99af829645ed9a60d (patch) | |
tree | 5fdf5f27e6ef600252a7fae22d758ffd537c58c1 | |
parent | 85763f09fe0ad1f295457fdfd5ac3c4b405821f4 (diff) | |
download | ceph-b2eb8bd2ede7ab53ba0660f99af829645ed9a60d.tar.gz |
osd: implement 'version' tell command
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osd/OSD.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 217dd23b152..59c6366265c 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -34,6 +34,7 @@ #include "Watch.h" #include "common/ceph_argparse.h" +#include "common/version.h" #include "os/FileStore.h" #include "os/FileJournal.h" @@ -2872,7 +2873,12 @@ void OSD::do_command(Connection *con, tid_t tid, vector<string>& cmd, bufferlist dout(20) << "do_command tid " << tid << " " << cmd << dendl; - if (cmd[0] == "injectargs") { + if (cmd[0] == "version") { + ss << pretty_version_to_str(); + r = 0; + goto out; + } + else if (cmd[0] == "injectargs") { if (cmd.size() < 2) { r = -EINVAL; ss << "ignoring empty injectargs"; |