]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: remove useless op ret assign
authorimtzw <tongzhiwei_yewu@cmss.chinamobile.com>
Tue, 27 Jun 2023 01:18:09 +0000 (09:18 +0800)
committerimtzw <tongzhiwei_yewu@cmss.chinamobile.com>
Tue, 27 Jun 2023 01:24:03 +0000 (09:24 +0800)
in op rgwsetbucketwebsite_objstore_s3 and rgwputcors_objstore_s3 get_param
trys to assign op_ret which will be overwritten by return value.
use this to be assigned value as the return value will result in
a same http response because in rgw_common rgw_http_s3_errors will translate
them into the same.

Signed-off-by: imtzw <tongzhiwei_yewu@cmss.chinamobile.com>
src/rgw/rgw_rest_s3.cc

index d777b52d7f2d31ce71fb8421d71ec1826d64eab3..468d5ce51b8ce3ee506a8e373e470be6dfd3b5c7 100644 (file)
@@ -2270,11 +2270,10 @@ int RGWSetBucketWebsite_ObjStore_S3::get_params(optional_yield y)
                      << max_num
                      << " rules, request website routing rules num: "
                      << routing_rules_num << dendl;
-    op_ret = -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR;
     s->err.message = std::to_string(routing_rules_num) +" routing rules provided, the number of routing rules in a website configuration is limited to "
                      + std::to_string(max_num)
                      + ".";
-    return -ERR_INVALID_REQUEST;
+    return -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR;
   }
 
   return 0;
@@ -3716,10 +3715,9 @@ int RGWPutCORS_ObjStore_S3::get_params(optional_yield y)
                      << max_num
                      << " rules, request cors rules num: "
                      << cors_rules_num << dendl;
-    op_ret = -ERR_INVALID_CORS_RULES_ERROR;
     s->err.message = "The number of CORS rules should not exceed allowed limit of "
                      + std::to_string(max_num) + " rules.";
-    return -ERR_INVALID_REQUEST;
+    return -ERR_INVALID_CORS_RULES_ERROR;
   }
 
   // forward bucket cors requests to meta master zone