]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: ENOENT on disabling non-existend app
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 22 Jul 2017 09:54:59 +0000 (17:54 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 25 Jul 2017 05:19:29 +0000 (13:19 +0800)
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>
qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc

index 41a036e8514ce738a6e5ccc6bda812f33c061318..f7f45ccc41a87fd1b3bd0a2cde57e612fa5e4e52 100755 (executable)
@@ -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":{}}'
 
index 3315e366eec0e945fba8b3d0a4b6823c299f9018..d39c3eed061d4912a6774ba6aeb9e764af825316 100644 (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 << "'";