]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: remove detail option for `mgr module ls` command 43411/head
authorLaura Flores <lflores@redhat.com>
Fri, 15 Oct 2021 16:07:01 +0000 (16:07 +0000)
committerLaura Flores <lflores@redhat.com>
Fri, 15 Oct 2021 16:20:16 +0000 (16:20 +0000)
Signed-off-by: Laura Flores <lflores@redhat.com>
doc/man/8/ceph.rst
doc/mgr/administrator.rst
src/mon/MgrMonitor.cc
src/mon/MonCommands.h

index af381df92ea8a11d1d6c90555a144deab9f71e01..639d85e565d6f23180764f0d998605e8441aef12 100644 (file)
@@ -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``.
 
index 6115d171c014c06938d3c9480ab9105ccf8cd170..411ad8c38b7c184b4fc884e5cd8260d1cd816f37 100644 (file)
@@ -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 <module>`` and
 ``ceph mgr module disable <module>`` respectively.
index c9458aab4eeb98a5986fb47cb530a687ca1d2bd1..ed44af17d0203b2c3adf2dee47daa4cda3aaa35c 100644 (file)
@@ -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();
index 78129f336e256fc885d01e745bf64f9572971b74..cd2bc434a24c856d1cfe12f1d9dd07eec0819328 100644 (file)
@@ -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",