]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: user rename calls update() to write final user
authorCasey Bodley <cbodley@redhat.com>
Tue, 6 Aug 2019 15:09:03 +0000 (11:09 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 7 Aug 2019 20:25:12 +0000 (16:25 -0400)
this calls remove_old_indexes() to clean up the uid and buckets index
objects, and also sets 'old_info = user_info' so that radosgw-admin
dumps the json output of the renamed user instead of the old user

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_user.cc

index 4d8be2198d5d69b74e4a9795ff905b0677c016f7..ef6c0ef5bfb5b4535040ffbe896bb315564506f2 100644 (file)
@@ -2063,15 +2063,10 @@ int RGWUser::execute_user_rename(RGWUserAdminOpState& op_state, std::string *err
 
   // update the 'stub user' with all of the other fields and rewrite all of the
   // associated index objects
-  RGWUserInfo user_info = old_user_info;
-  user_info.user_id = stub_user_info.user_id;
+  op_state.get_user_info().user_id = uid;
+  op_state.objv = objv;
 
-  ret = rgw_store_user_info(store, user_info, &old_user_info, &objv, real_time(), false);
-  if (ret < 0) {
-    set_err_msg(err_msg, "unable to store new user info");
-    return ret;
-  }
-  return 0;
+  return update(op_state, err_msg);
 }
 
 int RGWUser::execute_rename(RGWUserAdminOpState& op_state, RGWUserInfo& old_user_info, std::string *err_msg)