]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/PyModules: add 'pg_status' dump
authorSage Weil <sage@redhat.com>
Tue, 11 Jul 2017 20:25:42 +0000 (16:25 -0400)
committerJohn Spray <john.spray@redhat.com>
Wed, 1 Nov 2017 23:03:21 +0000 (23:03 +0000)
This is summary info, same as what's in 'ceph status'.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 85b5b80906d00e098d4b1af1354c60a357022dd2)

src/mgr/PyModules.cc

index 6b3b50e599c9fff766c8b745690183501289b1f8..ef3ba72fe65207540fc085afff397dbed46ffbc7 100644 (file)
@@ -264,6 +264,14 @@ PyObject *PyModules::get_python(const std::string &what)
         }
     );
     return f.get();
+  } else if (what == "pg_status") {
+    PyFormatter f;
+    cluster_state.with_pgmap(
+        [&f](const PGMap &pg_map) {
+         pg_map.print_summary(&f, nullptr);
+        }
+    );
+    return f.get();
 
   } else if (what == "df") {
     PyFormatter f;