]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_objectstore_tool: Strip _* (always _head) from pgid in list entry output
authorDavid Zafman <dzafman@redhat.com>
Thu, 4 Dec 2014 01:53:11 +0000 (17:53 -0800)
committerLoic Dachary <ldachary@redhat.com>
Fri, 5 Dec 2014 12:01:36 +0000 (13:01 +0100)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/tools/ceph_objectstore_tool.cc

index 079f92611bfefa856d40fa842f2f5346c3b3213e..ebb0dfe17ec6ac8993e3d4f04ecb73a345b7f86a 100644 (file)
@@ -470,7 +470,12 @@ struct pgid_object_list {
         cout << std::endl;
       }
       f->open_array_section("pgid_object");
-      i->first.dump(f);
+      string pgid = i->first.c_str();
+      std::size_t pos = pgid.find("_");
+      if (pos == string::npos)
+        f->dump_string("pgid", pgid);
+      else
+        f->dump_string("pgid", pgid.substr(0, pos));
       f->open_object_section("ghobject");
       i->second.dump(f);
       f->close_section();