From: Laura Flores Date: Fri, 15 Oct 2021 16:07:01 +0000 (+0000) Subject: mon: remove detail option for `mgr module ls` command X-Git-Tag: v17.1.0~466^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46236139f9f3aa722ee533deb41f7c651b2df5b9;p=ceph.git mon: remove detail option for `mgr module ls` command Signed-off-by: Laura Flores --- diff --git a/doc/man/8/ceph.rst b/doc/man/8/ceph.rst index af381df92ea8a..639d85e565d6f 100644 --- a/doc/man/8/ceph.rst +++ b/doc/man/8/ceph.rst @@ -580,7 +580,7 @@ Subcommand ``module ls`` will list currently enabled manager modules (plugins). Usage:: - ceph mgr module ls {detail} + ceph mgr module ls Subcommand ``module enable`` will enable a manager module. Available modules are included in MgrMap and visible via ``mgr dump``. diff --git a/doc/mgr/administrator.rst b/doc/mgr/administrator.rst index 6115d171c014c..411ad8c38b7c1 100644 --- a/doc/mgr/administrator.rst +++ b/doc/mgr/administrator.rst @@ -57,7 +57,7 @@ Using modules ------------- Use the command ``ceph mgr module ls`` to see which modules are -available, and which are currently enabled. Use ``ceph mgr module ls detail`` +available, and which are currently enabled. Use ``ceph mgr module ls --format=json-pretty`` to view detailed metadata about disabled modules. Enable or disable modules using the commands ``ceph mgr module enable `` and ``ceph mgr module disable `` respectively. diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index c9458aab4eeb9..ed44af17d0203 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -25,7 +25,6 @@ #include "HealthMonitor.h" #include "common/TextTable.h" -#include "common/cmdparse.h" #include "include/stringify.h" #include "MgrMonitor.h" @@ -955,7 +954,6 @@ bool MgrMonitor::preprocess_command(MonOpRequestRef op) string prefix; cmd_getval(cmdmap, "prefix", prefix); - int r = 0; if (prefix == "mgr stat") { @@ -991,12 +989,7 @@ bool MgrMonitor::preprocess_command(MonOpRequestRef op) } f->flush(rdata); } else if (prefix == "mgr module ls") { - string detail; - cmd_getval(cmdmap, "detail", detail); - if (f || (detail == "detail")) { - if (!f) { - f.reset(Formatter::create(format, "json-pretty", "json-pretty")); - } + if (f) { f->open_object_section("modules"); { f->open_array_section("always_on_modules"); @@ -1017,14 +1010,9 @@ bool MgrMonitor::preprocess_command(MonOpRequestRef op) for (auto& p : map.available_modules) { if (map.modules.count(p.name) == 0 && map.get_always_on_modules().count(p.name) == 0) { - if (detail == "detail") { - // For disabled modules, we show the full info if the detail - // parameter is enabled, to give a hint about whether enabling it will work - p.dump(f.get()); - } else { - // Otherwise, we give a shortened summary by default - f->dump_string("module", p.name); - } + // For disabled modules, we show the full info if the detail + // parameter is enabled, to give a hint about whether enabling it will work + p.dump(f.get()); } } f->close_section(); diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index 78129f336e256..cd2bc434a24c8 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -1231,7 +1231,7 @@ COMMAND("mgr dump " "mgr", "r") COMMAND("mgr fail name=who,type=CephString,req=false", "treat the named manager daemon as failed", "mgr", "rw") -COMMAND("mgr module ls name=detail,type=CephChoices,strings=detail,req=false", +COMMAND("mgr module ls", "list active mgr modules", "mgr", "r") COMMAND("mgr services", "list service endpoints provided by mgr modules",