]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: propagate Trash::purge() result
authorIlya Dryomov <idryomov@gmail.com>
Wed, 26 May 2021 12:21:22 +0000 (14:21 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 28 May 2021 20:19:54 +0000 (22:19 +0200)
Exit with respective status like other commands do.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/tools/rbd/action/Trash.cc

index dacedd347a23e57d8e45c2e91eb9f27e67d00afa..ba09c6406df8ece5cb703ab7f9767f894ea2a501 100644 (file)
@@ -400,8 +400,8 @@ void get_purge_arguments(po::options_description *positional,
        "value range: 0.0-1.0");
 }
 
-int execute_purge (const po::variables_map &vm,
-                   const std::vector<std::string> &ceph_global_init_args) {
+int execute_purge(const po::variables_map &vm,
+                  const std::vector<std::string> &ceph_global_init_args) {
   std::string pool_name;
   std::string namespace_name;
   size_t arg_index = 0;
@@ -446,10 +446,10 @@ int execute_purge (const po::variables_map &vm,
   r = rbd.trash_purge_with_progress(io_ctx, expire_ts, threshold, pc);
   if (r < 0) {
     pc.fail();
-  } else {
-    pc.finish();
+    return r;
   }
 
+  pc.finish();
   return 0;
 }