]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rados: only suggest changing mon_allow_pool_delete on EPERM
authorSage Weil <sage@redhat.com>
Tue, 30 Jan 2018 15:12:39 +0000 (09:12 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:49 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/tools/rados/rados.cc

index a9235bc26399f8c60134dcd730f3eab945b4f84f..c1fe40cc98c6be7f9cfcd7ae56809c309c789ccf 100644 (file)
@@ -2918,10 +2918,12 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     ret = rados.pool_delete(nargs[1]);
     if (ret >= 0) {
       cout << "successfully deleted pool " << nargs[1] << std::endl;
-    } else { //error
+    } else {
       cerr << "pool " << nargs[1] << " could not be removed" << std::endl;
-      cerr << "Check your monitor configuration - `mon allow pool delete` is set to false by default,"
-     << " change it to true to allow deletion of pools" << std::endl;
+      if (ret == -EPERM) {
+       cerr << "Check your monitor configuration - `mon allow pool delete` is set to false by default,"
+            << " change it to true to allow deletion of pools" << std::endl;
+      }
     }
   }
   else if (strcmp(nargs[0], "purge") == 0) {