]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/PyModules: add 'pg_dump' get
authorSage Weil <sage@redhat.com>
Thu, 27 Jul 2017 14:06:45 +0000 (10:06 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:21 +0000 (23:03 +0000)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit bfb9286f4212947183c46543d609b664ea13b489)

src/mgr/PyModules.cc

index ef3ba72fe65207540fc085afff397dbed46ffbc7..501c6037c3d309a02d658e2ef5e5051b85caccc2 100644 (file)
@@ -272,7 +272,14 @@ PyObject *PyModules::get_python(const std::string &what)
         }
     );
     return f.get();
-
+  } else if (what == "pg_dump") {
+    PyFormatter f;
+        cluster_state.with_pgmap(
+        [&f](const PGMap &pg_map) {
+         pg_map.dump(&f);
+        }
+    );
+    return f.get();
   } else if (what == "df") {
     PyFormatter f;