]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: implement `config set`
authorJohn Spray <john.spray@redhat.com>
Wed, 12 Jul 2017 14:09:33 +0000 (10:09 -0400)
committerJohn Spray <john.spray@redhat.com>
Fri, 21 Jul 2017 10:27:27 +0000 (06:27 -0400)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDSDaemon.cc

index 62b2a02f69535f04b44374814161e6fb913a65f2..86f43eca29de279e0e36684ec20917aef12a4f27 100644 (file)
@@ -641,6 +641,10 @@ COMMAND("injectargs " \
        "name=injected_args,type=CephString,n=N",
        "inject configuration arguments into running MDS",
        "mds", "*", "cli,rest")
+COMMAND("config set " \
+       "name=key,type=CephString name=value,type=CephString",
+       "Set a configuration option at runtime (not persistent)",
+       "mds", "*", "cli,rest")
 COMMAND("exit",
        "Terminate this MDS",
        "mds", "*", "cli,rest")
@@ -757,6 +761,12 @@ int MDSDaemon::_handle_command(
     for (vector<string>::iterator a = ++argsvec.begin(); a != argsvec.end(); ++a)
       args += " " + *a;
     r = cct->_conf->injectargs(args, &ss);
+  } else if (prefix == "config set") {
+    std::string key;
+    cmd_getval(cct, cmdmap, "key", key);
+    std::string val;
+    cmd_getval(cct, cmdmap, "value", val);
+    r = cct->_conf->set_val(key, val, true, &ss);
   } else if (prefix == "exit") {
     // We will send response before executing
     ss << "Exiting...";