From: Sage Weil Date: Thu, 27 Jul 2017 14:06:45 +0000 (-0400) Subject: mgr/PyModules: add 'pg_dump' get X-Git-Tag: v12.2.2~61^2~105 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b721632aa8271d74b319714db0a9fedacb2629b;p=ceph.git mgr/PyModules: add 'pg_dump' get Signed-off-by: Sage Weil (cherry picked from commit bfb9286f4212947183c46543d609b664ea13b489) --- diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index ef3ba72fe65..501c6037c3d 100644 --- a/src/mgr/PyModules.cc +++ b/src/mgr/PyModules.cc @@ -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;