mon/OSDMonitor: ENOENT on disabling non-existend app

so we don't bother to trigger an pool update, which is potentially
big stuff.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
xie xingguo 2017-07-22 17:54:59 +08:00
parent b61cbe704c
commit b4dcdecb6a
2 changed files with 7 additions and 0 deletions

View File

@ -2377,6 +2377,7 @@ function test_mon_pool_application()
expect_false ceph osd pool application disable app_for_test rgw
ceph osd pool application disable app_for_test rgw --yes-i-really-mean-it
ceph osd pool application disable app_for_test rgw --yes-i-really-mean-it # should be idempotent
ceph osd pool ls detail | grep "application rbd"
ceph osd pool ls detail --format=json | grep '"application_metadata":{"rbd":{}}'

View File

@ -6435,6 +6435,12 @@ int OSDMonitor::prepare_command_pool_application(const string &prefix,
return -EPERM;
}
if (!app_exists) {
ss << "application '" << app << "' is not enabled on pool '" << pool_name
<< "'";
return 0; // idempotent
}
p.application_metadata.erase(app);
ss << "disable application '" << app << "' on pool '" << pool_name << "'";