]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MgrMonitor: show different error message when disabling a dne module 34143/head
authorKefu Chai <kchai@redhat.com>
Tue, 24 Mar 2020 13:14:43 +0000 (21:14 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 24 Mar 2020 13:24:53 +0000 (21:24 +0800)
this is a regression introduced by
a7677c76a54bdbc68ea9ba60efe7cec013d5afda

per Sage, we can enable a module when the mgr is not started yet using
"--force" command, but we should be allowed to disable it if the
non-existent module is added. this change just changes the condition and
error message so that the error message is printed if the module is not
loaded at all. because the operation should be idempotent, so the
operation is always finished without returning an error.

Fixes: https://tracker.ceph.com/issues/44728
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MgrMonitor.cc

index ef126edd65222ad61a99ae16b2739351ab3cf207..fc7d5becf022033f70faccf3e8aaa08a3370e21a 100644 (file)
@@ -1158,8 +1158,8 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op)
       r = 0;
       goto out;
     }
-    if (!pending_map.any_supports_module(module)) {
-      ss << "module '" << module << "' does not exist";
+    if (!pending_map.modules.count(module)) {
+      ss << "module '" << module << "' is not enabled";
     }
     pending_map.modules.erase(module);
   } else {