]> 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)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 19:20:58 +0000 (11:20 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 5eacd3c5f39766cb8be6b3251d139d16431cf6b6)

src/tools/ceph_objectstore_tool.cc

index 170f83a80f8b2d3cddedd2dfa94ee87fe57b9134..8e82b47602a1bfc038ea2930fa44cecfacce95be 100644 (file)
@@ -468,7 +468,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();