return false;
}
-static string indent_who(const string& who)
-{
- if (who == "global") {
- return who;
- }
- if (who.find('.') == string::npos) {
- return " " + who;
- }
- return " " + who;
-}
-
bool ConfigMonitor::preprocess_command(MonOpRequestRef op)
{
auto m = op->get_req<MMonCommand>();
mon.reply_command(op, -EINVAL, rs, get_last_committed());
return true;
}
- string format;
- cmd_getval(cmdmap, "format", format, string("plain"));
+ string format = cmd_getval_or<string>(cmdmap, "format", "plain");
boost::scoped_ptr<Formatter> f(Formatter::create(format));
string prefix;
for (auto s : sections) {
for (auto& i : s.second->options) {
if (!f) {
- tbl << indent_who(s.first);
+ tbl << s.first;
tbl << i.second.mask.to_str();
tbl << Option::level_to_str(i.second.opt->level);
tbl << i.first;
goto reply;
}
if (!entity.is_client() &&
- !boost::get<boost::blank>(&opt->daemon_value)) {
+ opt->daemon_value != Option::value_t{}) {
odata.append(Option::to_str(opt->daemon_value));
} else {
odata.append(Option::to_str(opt->value));
bl.append(value);
pending[key] = bl;
} else {
- pending[key] = boost::none;
+ pending[key].reset();
}
goto update;
} else if (prefix == "config reset") {
bl.append(*i.second.first);
pending[i.first] = bl;
} else if (i.second.second) {
- pending[i.first] = boost::none;
+ pending[i.first].reset();
}
}
}
if (p != renamed_pacific.end()) {
if (mon.monmap->min_mon_release >= ceph_release_t::pacific) {
// schedule a cleanup
- pending_cleanup[key] = boost::none;
+ pending_cleanup[key].reset();
pending_cleanup[who + "/" + p->second] = it->value();
}
// continue loading under the new name
if (who.size() &&
!ConfigMap::parse_mask(who, §ion_name, &mopt.mask)) {
derr << __func__ << " invalid mask for key " << key << dendl;
- pending_cleanup[key] = boost::none;
+ pending_cleanup[key].reset();
} else if (opt->has_flag(Option::FLAG_NO_MON_UPDATE)) {
dout(10) << __func__ << " NO_MON_UPDATE option '"
<< name << "' = '" << value << "' for " << name
<< dendl;
- pending_cleanup[key] = boost::none;
+ pending_cleanup[key].reset();
} else {
if (section_name.empty()) {
// we prefer global/$option instead of just $option
derr << __func__ << " adding global/ prefix to key '" << key << "'"
<< dendl;
- pending_cleanup[key] = boost::none;
+ pending_cleanup[key].reset();
pending_cleanup["global/"s + key] = it->value();
}
Section *section = &config_map.global;;