From: Sage Weil Date: Wed, 31 Jan 2018 13:09:09 +0000 (-0600) Subject: osd: implement tell/daemon 'config get' X-Git-Tag: v13.0.2~78^2~40 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=904604eba407fcbf20a991877d2250b2ed8bb2c7;p=ceph.git osd: implement tell/daemon 'config get' Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 7d89eefa6b96f..bf1659fba2182 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5828,6 +5828,10 @@ COMMAND("config set " \ "name=key,type=CephString name=value,type=CephString", "Set a configuration option at runtime (not persistent)", "osd", "rw", "cli,rest") +COMMAND("config get " \ + "name=key,type=CephString", + "Get a configuration option at runtime", + "osd", "r", "cli,rest") COMMAND("config unset " \ "name=key,type=CephString", "Unset a configuration option at runtime (not persistent)", @@ -5961,6 +5965,17 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector& cmd, buffe } osd_lock.Lock(); } + else if (prefix == "config get") { + std::string key; + cmd_getval(cct, cmdmap, "key", key); + osd_lock.Unlock(); + std::string val; + r = cct->_conf->get_val(key, &val); + if (r == 0) { + ds << val; + } + osd_lock.Lock(); + } else if (prefix == "config unset") { std::string key; cmd_getval(cct, cmdmap, "key", key);