]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: unconditionally dump message in formatter
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 23 May 2024 19:58:48 +0000 (15:58 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 4 Jun 2024 19:44:25 +0000 (15:44 -0400)
It's unpleasant to test for existence in json. Just dump an empty string if not present.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSRank.cc

index 083edc7120e9c584754548b92ff1e677cbc97323..783ffccc5aefb517bc126eb8f9dad7bea3e57c1f 100644 (file)
@@ -2668,8 +2668,7 @@ void MDSRankDispatcher::handle_asok_command(
 
     void finish(int rc) override {
       f->open_object_section("result");
-      if (!ss.view().empty()) {
-        f->dump_string("message", ss.view());
+      f->dump_string("message", ss.view());
       f->dump_int("return_code", rc);
       f->close_section();