]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: fix dump()
authorSage Weil <sage@redhat.com>
Fri, 5 Jan 2018 19:45:02 +0000 (13:45 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:48 +0000 (14:44 -0600)
By convention dump() does not include the containing object section.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/ceph_context.cc
src/common/options.cc

index 582788da4c4e453611747cad2b5450c524c72606..4a342b5bb4b6919e5db2c10bb2a55c6c8279a135 100644 (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();
       }
index 6628ca5b7eba10df0e38183f7c8510a740b0b161..7aef433816608b283246f0a2a4d8da76ad8f356c 100644 (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)