Skip to content

Commit

Permalink
mon,mgr: improve 'mgr module enable' cmd
Browse files Browse the repository at this point in the history
check if the module is enabled already.

Signed-off-by: Gu Zhongyan <guzhongyan@360.cn>
  • Loading branch information
guzhongyan committed Apr 11, 2018
1 parent 8ec78db commit b0c3120
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mon/MgrMonitor.cc
Expand Up @@ -887,6 +887,11 @@ bool MgrMonitor::prepare_command(MonOpRequestRef op)
r = -ENOENT;
goto out;
}
if (pending_map.module_enabled(module)) {
ss << "module " << module << " is already enabled";
r = 0;
goto out;
}
pending_map.modules.insert(module);
} else if (prefix == "mgr module disable") {
string module;
Expand Down

0 comments on commit b0c3120

Please sign in to comment.