diff --git a/qa/workunits/cephtool/test.sh b/qa/workunits/cephtool/test.sh index 41a036e8514..f7f45ccc41a 100755 --- a/qa/workunits/cephtool/test.sh +++ b/qa/workunits/cephtool/test.sh @@ -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":{}}' diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 3315e366eec..d39c3eed061 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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 << "'";