]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make ceph tell mon.* version work
authorMykola Golub <mgolub@mirantis.com>
Mon, 29 Dec 2014 08:05:28 +0000 (10:05 +0200)
committerMykola Golub <mgolub@mirantis.com>
Mon, 5 Jan 2015 10:01:03 +0000 (12:01 +0200)
Fixes: #6767
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
qa/workunits/cephtool/test.sh
src/mon/MonCommands.h
src/mon/Monitor.cc

index aa325e80d688644e039f1860825e288ae02c7610..0aad890b8443e8cf4998385697388f21dc07cda7 100755 (executable)
@@ -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
 
index 4e3a01b8232d77cecc0de0bdf2ed2a183afa1d67..a7c6ca0360061fbe179203fc2274c6e089fd5f8e 100644 (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)
index 52753a62fb4c12f486886d92f6ec09001c853733..78e2061fe6bebf4d74d09f0423ac2bd896aee1b9 100644 (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: