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>
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 {