From 1b721632aa8271d74b319714db0a9fedacb2629b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 27 Jul 2017 10:06:45 -0400 Subject: [PATCH] mgr/PyModules: add 'pg_dump' get Signed-off-by: Sage Weil (cherry picked from commit bfb9286f4212947183c46543d609b664ea13b489) --- src/mgr/PyModules.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mgr/PyModules.cc b/src/mgr/PyModules.cc index ef3ba72fe6520..501c6037c3d30 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; -- 2.39.5