From: John Spray Date: Wed, 1 Nov 2017 10:35:14 +0000 (-0400) Subject: mon: include disabled modules in `mgr module ls` X-Git-Tag: v13.0.1~332^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16651%2Fhead;p=ceph.git mon: include disabled modules in `mgr module ls` Otherwise, when someone wants to see what's possible to do with `mgr module enable` they have to trawl through the whole mgr map dump. Signed-off-by: John Spray --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index 3c0320aa8d3..751ed45e811 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -697,9 +697,20 @@ bool MgrMonitor::preprocess_command(MonOpRequestRef op) } f->flush(rdata); } else if (prefix == "mgr module ls") { - f->open_array_section("modules"); - for (auto& p : map.modules) { - f->dump_string("module", p); + f->open_object_section("modules"); + { + f->open_array_section("enabled_modules"); + for (auto& p : map.modules) { + f->dump_string("module", p); + } + f->close_section(); + f->open_array_section("disabled_modules"); + for (auto& p : map.available_modules) { + if (map.modules.count(p) == 0) { + f->dump_string("module", p); + } + } + f->close_section(); } f->close_section(); f->flush(rdata);