]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw multisite: obsolete 'radosgw-admin period prepare' command 11574/head
authorGaurav Kumar Garg <garg.gaurav52@gmail.com>
Fri, 30 Sep 2016 11:56:20 +0000 (13:56 +0200)
committerGaurav Kumar Garg <garg.gaurav52@gmail.com>
Thu, 20 Oct 2016 08:08:01 +0000 (10:08 +0200)
All that the 'radosgw-admin period prepare' command does is create an
empty period and write it to rados. When we added the staging period
(see 'period get --staging'), uncommitted changes were written to that
instead - so the 'period prepare' command became obsolete. It should be
removed!

Fixes: http://tracker.ceph.com/issues/17387
Reported-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Gaurav Kumar Garg <garg.gaurav52@gmail.com>
(cherry picked from commit 1508c70d36baae06377629416ff05b4138ccfbd4)

src/rgw/rgw_admin.cc
src/test/cli/radosgw-admin/help.t

index 453de3b1a583dd0156bb0fe5355d27af756071a7..8701a94722e2a186f076a690ec3ffed9c978953f 100644 (file)
@@ -73,7 +73,6 @@ void _usage()
   cout << "  object rm                  remove object\n";
   cout << "  object unlink              unlink object from bucket index\n";
   cout << "  objects expire             run expired objects cleanup\n";
-  cout << "  period prepare             prepare a new period\n";
   cout << "  period delete              delete a period\n";
   cout << "  period get                 get period info\n";
   cout << "  period get-current         get current period info\n";
@@ -364,7 +363,6 @@ enum {
   OPT_REALM_SET,
   OPT_REALM_DEFAULT,
   OPT_REALM_PULL,
-  OPT_PERIOD_PREPARE,
   OPT_PERIOD_DELETE,
   OPT_PERIOD_GET,
   OPT_PERIOD_GET_CURRENT,
@@ -538,8 +536,6 @@ static int get_cmd(const char *cmd, const char *prev_cmd, const char *prev_prev_
     if (strcmp(cmd, "list") == 0)
       return OPT_BI_LIST;
   } else if (strcmp(prev_cmd, "period") == 0) {
-    if (strcmp(cmd, "prepare") == 0)
-      return OPT_PERIOD_PREPARE;
     if (strcmp(cmd, "delete") == 0)
       return OPT_PERIOD_DELETE;
     if (strcmp(cmd, "get") == 0)
@@ -2420,7 +2416,7 @@ int main(int argc, char **argv)
                         opt_cmd == OPT_ZONE_CREATE || opt_cmd == OPT_ZONE_DELETE ||
                          opt_cmd == OPT_ZONE_GET || opt_cmd == OPT_ZONE_SET || opt_cmd == OPT_ZONE_RENAME ||
                          opt_cmd == OPT_ZONE_LIST || opt_cmd == OPT_ZONE_MODIFY || opt_cmd == OPT_ZONE_DEFAULT ||
-                        opt_cmd == OPT_REALM_CREATE || opt_cmd == OPT_PERIOD_PREPARE ||
+                        opt_cmd == OPT_REALM_CREATE ||
                         opt_cmd == OPT_PERIOD_DELETE || opt_cmd == OPT_PERIOD_GET ||
                         opt_cmd == OPT_PERIOD_GET_CURRENT || opt_cmd == OPT_PERIOD_LIST ||
                          raw_period_update || raw_period_pull ||
@@ -2454,29 +2450,6 @@ int main(int argc, char **argv)
 
   if (raw_storage_op) {
     switch (opt_cmd) {
-    case OPT_PERIOD_PREPARE:
-      {
-       RGWRealm realm(realm_id, realm_name);
-       int ret = realm.init(g_ceph_context, store);
-       if (ret < 0) {
-         cerr << "could not init realm " << ": " << cpp_strerror(-ret) << std::endl;
-         return ret;
-       }
-       RGWPeriod period;
-       ret = period.init(g_ceph_context, store, realm.get_id(), realm.get_name(), false);
-       if (ret < 0) {
-         cerr << "failed to init period " << ": " << cpp_strerror(-ret) << std::endl;
-         return ret;
-       }
-       ret = period.create();
-       if (ret < 0) {
-         cerr << "ERROR: couldn't create period " << ": " << cpp_strerror(-ret) << std::endl;
-         return ret;
-       }
-       encode_json("period", period, formatter);
-       formatter->flush(cout);
-      }
-      break;
     case OPT_PERIOD_DELETE:
       {
        if (period_id.empty()) {
index 5fb1321ebd42561329071eccb456d0d4baf0f260..b2d519c23ed0d33ab9a4a93b9a12a1580d1b2ab4 100644 (file)
@@ -25,7 +25,6 @@
     object rm                  remove object
     object unlink              unlink object from bucket index
     objects expire             run expired objects cleanup
-    period prepare             prepare a new period
     period delete              delete a period
     period get                 get period info
     period get-current         get current period info