osd,mds: 'config unset' tell command

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-01-05 16:44:00 -06:00
parent 0db8fd2418
commit 5b603ec8e6
2 changed files with 25 additions and 0 deletions

View File

@ -659,6 +659,10 @@ COMMAND("config set " \
"name=key,type=CephString name=value,type=CephString",
"Set a configuration option at runtime (not persistent)",
"mds", "*", "cli,rest")
COMMAND("config unset " \
"name=key,type=CephString",
"Unset a configuration option at runtime (not persistent)",
"mds", "*", "cli,rest")
COMMAND("exit",
"Terminate this MDS",
"mds", "*", "cli,rest")
@ -799,6 +803,13 @@ int MDSDaemon::_handle_command(
if (r == 0) {
cct->_conf->apply_changes(nullptr);
}
} else if (prefix == "config unset") {
std::string key;
cmd_getval(cct, cmdmap, "key", key);
r = cct->_conf->rm_val(key);
if (r == 0) {
cct->_conf->apply_changes(nullptr);
}
} else if (prefix == "exit") {
// We will send response before executing
ss << "Exiting...";

View File

@ -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 unset " \
"name=key,type=CephString",
"Unset a configuration option at runtime (not persistent)",
"osd", "rw", "cli,rest")
COMMAND("cluster_log " \
"name=level,type=CephChoices,strings=error,warning,info,debug " \
"name=message,type=CephString,n=N",
@ -5957,6 +5961,16 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector<string>& cmd, buffe
}
osd_lock.Lock();
}
else if (prefix == "config unset") {
std::string key;
cmd_getval(cct, cmdmap, "key", key);
osd_lock.Unlock();
r = cct->_conf->rm_val(key);
if (r == 0) {
cct->_conf->apply_changes(nullptr);
}
osd_lock.Lock();
}
else if (prefix == "cluster_log") {
vector<string> msg;
cmd_getval(cct, cmdmap, "message", msg);