common/options: fix dump()

By convention dump() does not include the containing object section.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2018-01-05 13:45:02 -06:00
parent 86a6cf778c
commit 49a5e775aa
2 changed files with 2 additions and 5 deletions

View File

@ -480,13 +480,13 @@ void CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
msg << "Setting not found: '" << key << "'";
f->dump_string("error", msg.str());
} else {
i->second.dump(f);
f->dump_object("option", i->second);
}
} else {
// Output all
f->open_array_section("options");
for (const auto &option : ceph_options) {
option.dump(f);
f->dump_object("option", option);
}
f->close_section();
}

View File

@ -159,7 +159,6 @@ int Option::parse_value(
void Option::dump(Formatter *f) const
{
f->open_object_section("option");
f->dump_string("name", name);
f->dump_string("type", type_to_str(type));
@ -200,8 +199,6 @@ void Option::dump(Formatter *f) const
dump_value("min", min, f);
dump_value("max", max, f);
f->close_section();
}
ostream& operator<<(ostream& out, const Option::value_t& v)