]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove redundant quota logic from admin/user api
authorCasey Bodley <cbodley@redhat.com>
Wed, 19 Sep 2018 13:35:03 +0000 (09:35 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 19 Sep 2018 13:35:06 +0000 (09:35 -0400)
RGWOp_User_Create was applying the configured default quotas to the
RGWUserAdminOpState, but RGWUser::execute_add() will already apply those
defaults when the AdminOpState doesn't provide them

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

index 3782246f1f28c04b25fc4b334b1ebc690693ee03..78ac94cf9a1e76f7738edd78452e8ebad9fd749b 100644 (file)
@@ -153,37 +153,6 @@ void RGWOp_User_Create::execute()
   if (gen_key)
     op_state.set_generate_key();
 
-  RGWQuotaInfo bucket_quota;
-  RGWQuotaInfo user_quota;
-
-  if (s->cct->_conf->rgw_bucket_default_quota_max_objects >= 0) {
-    bucket_quota.max_objects = s->cct->_conf->rgw_bucket_default_quota_max_objects;
-    bucket_quota.enabled = true;
-  }
-
-  if (s->cct->_conf->rgw_bucket_default_quota_max_size >= 0) {
-    bucket_quota.max_size = s->cct->_conf->rgw_bucket_default_quota_max_size;
-    bucket_quota.enabled = true;
-  }
-
-  if (s->cct->_conf->rgw_user_default_quota_max_objects >= 0) {
-    user_quota.max_objects = s->cct->_conf->rgw_user_default_quota_max_objects;
-    user_quota.enabled = true;
-  }
-
-  if (s->cct->_conf->rgw_user_default_quota_max_size >= 0) {
-    user_quota.max_size = s->cct->_conf->rgw_user_default_quota_max_size;
-    user_quota.enabled = true;
-  }
-
-  if (bucket_quota.enabled) {
-    op_state.set_bucket_quota(bucket_quota);
-  }
-
-  if (user_quota.enabled) {
-    op_state.set_user_quota(user_quota);
-  }
-
   http_ret = RGWUserAdminOp_User::create(store, op_state, flusher);
 }