From: Kefu Chai Date: Tue, 24 Mar 2020 13:14:43 +0000 (+0800) Subject: mon/MgrMonitor: show different error message when disabling a dne module X-Git-Tag: v16.1.0~2661^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4bb2566ef5ca5ac02a5e6efa301ae9aaa3a99ce1;p=ceph.git mon/MgrMonitor: show different error message when disabling a dne module 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 --- diff --git a/src/mon/MgrMonitor.cc b/src/mon/MgrMonitor.cc index ef126edd6522..fc7d5becf022 100644 --- a/src/mon/MgrMonitor.cc +++ b/src/mon/MgrMonitor.cc @@ -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 {