]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw-admin: link / unlink should report errors
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 17 Jul 2013 23:14:02 +0000 (16:14 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 19 Jul 2013 20:21:50 +0000 (13:21 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_admin.cc

index 0b7cb143400dadc164dfcd3a59980e07b0b91e32..239ec016389683dd383a17e2a28f923b70f4fb1b 100644 (file)
@@ -1387,11 +1387,19 @@ int main(int argc, char **argv)
   }
 
   if (opt_cmd == OPT_BUCKET_LINK) {
-   RGWBucketAdminOp::link(store, bucket_op);
+    int r = RGWBucketAdminOp::link(store, bucket_op);
+    if (r < 0) {
+      cerr << "failure: " << cpp_strerror(-r) << std::endl;
+      return -r;
+    }
   }
 
   if (opt_cmd == OPT_BUCKET_UNLINK) {
-    RGWBucketAdminOp::unlink(store, bucket_op);
+    int r = RGWBucketAdminOp::unlink(store, bucket_op);
+    if (r < 0) {
+      cerr << "failure: " << cpp_strerror(-r) << std::endl;
+      return -r;
+    }
   }
 
   if (opt_cmd == OPT_TEMP_REMOVE) {